Open jagdaleganesh opened 3 years ago
Any update when this plugin updated to compatible with latest ChartJs version
Same problem here. Definitely not compatible with the latest chartjs version.
I have the same problem (chart.js@3.5.1)
I have tried to update this plugin so that we can use with latest chartjs version 3 and above. I am not sure whether it is fully updated but with my change atleast I can use with latest chartjs version. @jghelen @ChrisRoss5 , hope this will help . chartjs-plugin-outlables.zip
var params = { display: true, //text: [ // '%l (%p.3) \n VALUE: (%v.3)', // '%l (%p) \n VALUE: (%v)', // 'SIMPLE VALUE \n => %v', // 'VALUE WITH PRECISION 4 \n => %v.4', // 'SIMPLE PERCENT \n => %p', // 'PERCENT WITH PRECISION 3 \n => %p.3', // 'JUST LABEL \n => %l', // 'JUST TEXT' //], borderWidth: 2, lineWidth: 2, padding: 3, textAlign: 'center', stretch: 45, font: { resizable: true, minSize: 12, maxSize: 25, family: Chart.defaults.font.family, size: Chart.defaults.font.size, style: Chart.defaults.font.style, lineHeight: Chart.defaults.font.lineHeight, }, color: "black", valuePrecision: 1, percentPrecision: 2 }; var chartOption = { maintainAspectRatio: false, zoomOutPercentage: 20, animation: false, layout: { padding: 50 }, plugins: { outlabels: params, } };
new Chart(ctx, { type: 'doughnut', plugins: [ChartOutLabels], data: { datasets: dataSets, labels: labels }, options: chartOption });
@jagdaleganesh how do I use this in a project?
@TijlDeclerckWd , you can just include js from attached zip and for uses I have already given code snippet.
And for those looking for a working version, check this repo out: https://github.com/energiency/chartjs-plugin-piechart-outlabels
This plugin is really awesome but looks like it is working with only 2.x chart js version. Can someone please share how I can make this plugin compatible with chartjs latest version.
Thanks,