chartjs-plugin-piechart-outlabels icon indicating copy to clipboard operation
chartjs-plugin-piechart-outlabels copied to clipboard

This is plugin is not compatible with 3.x chart js verstion

Open jagdaleganesh opened this issue 3 years ago • 8 comments

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,

jagdaleganesh avatar Aug 15 '21 19:08 jagdaleganesh

Any update when this plugin updated to compatible with latest ChartJs version

jagdaleganesh avatar Sep 15 '21 19:09 jagdaleganesh

Same problem here. Definitely not compatible with the latest chartjs version.

ChrisRoss5 avatar Sep 25 '21 16:09 ChrisRoss5

I have the same problem ([email protected])

jghelen avatar Oct 20 '21 20:10 jghelen

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 avatar Oct 21 '21 09:10 jagdaleganesh

@jagdaleganesh how do I use this in a project?

TijlDeclerckWd avatar May 25 '22 07:05 TijlDeclerckWd

@TijlDeclerckWd , you can just include js from attached zip and for uses I have already given code snippet.

jagdaleganesh avatar May 26 '22 08:05 jagdaleganesh

Hey, Guys alternatively you can try this. JSFIDDLE

emit077 avatar Jun 23 '22 13:06 emit077

And for those looking for a working version, check this repo out: https://github.com/energiency/chartjs-plugin-piechart-outlabels

AndreasK79 avatar Sep 19 '22 06:09 AndreasK79