How to use chart.js-plugin-labels-dv in meteor
Short answer: the same way you use it outside Meteor.
What seems to be the problem?
import ‘chart.js-plugin-labels-dv’;
CreateDistributionPercentagePie(elementId, objPerformance) {
const labelList = objPerformance.PercentExplanations.map(label => label.name);
const dataList = objPerformance.PercentExplanations.map(data => data.y);
const data = {
labels: labelList,
datasets: [
{
label: 'Topics',
data: dataList,
}
]
}
const options = {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false,
},
title: {
display: true,
text: 'Explanations Distribution by Percentages'
},
labels: [
{
render: 'label',
position: 'outside'
},
{
render: 'percentage'
}
]
},
}
var chart = new Chart(elementId, {
type: 'pie',
data: data,
options: options,
plugins: [ChartDataLabels],
});
},
This is my code, but it is not working in Meteor. Could you please have a look?
Thanks !
Your front-end is Blaze?
Yes, My front-end is Blaze.