Open MrWhiteX opened 2 years ago
Yes, I had the same issue, created a PR #15 which solves the issue.
I merged and released a v3.2.0, can you please guys test it out and let me know, thanks!
Now i have this error. Old webpack version? edit In older webpack version you have to add rule in webpack config:
.addRule({
test: /\/node_modules\/chart.js-plugin-labels-dv\/src\/chartjs-plugin-labels.js/,
loader: 'babel-loader',
options: {
'presets': ['@babel/preset-env'],
'plugins': ['@babel/plugin-proposal-optional-chaining']
}
});
Now it is working.
How to disable labels? because display:false
doesn't work.
Hello, someone know how to disable labels for this plugin? I have tried all the options but none works for example:
labels: {
render: "percentage",
position: "outside",
fontColor: data.colors,
fontStyle: "bolder",
fontSize: 15,
textMargin: 15,
dispalay: false,
},
ChartProvider method is working globally. How do you use it for just one chart? Thanks.
To disable labels you should not add labels object (options.plugins.labels) at all in that Chart. This anwsers also your second question about enabling the plugin for just one chart. But on React maybe the code you are using is enabling the plugin for any instance of chartprovider. Not sure how to change that.
To force not rendering the labels try also:
render: function (args) {
return ''
};
Thank you. This function is working well.
Hello, I'm trying to connect chartjs-plugin-labels with React. I have the newest versions of chart.js, chartjs-plugin-datalabels, react-chartjs-2 I am doing everything according to #5 and I receive this error.
What am I doing wrong ?
and return:
Anyone have any idea? Thank you.