Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jagdaleganesh opened this issue Aug 15, 2021 · 8 comments
Open

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

jagdaleganesh opened this issue Aug 15, 2021 · 8 comments

Comments

@jagdaleganesh
Copy link

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
Copy link
Author

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

@ChrisRoss5
Copy link

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

@jghelen
Copy link

jghelen commented Oct 20, 2021

I have the same problem ([email protected])

@jagdaleganesh
Copy link
Author

jagdaleganesh commented Oct 21, 2021

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
});

@TijlDeclerckWd
Copy link

@jagdaleganesh how do I use this in a project?

@jagdaleganesh
Copy link
Author

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

@emit077
Copy link

emit077 commented Jun 23, 2022

Hey, Guys alternatively you can try this.
JSFIDDLE

@AndreasK79
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants