chartjs-plugin-labels
chartjs-plugin-labels copied to clipboard
Can't disable for specific charts
I'm using this to show percentages on some doughnut charts. The problem I'm running into is that I also have some bar charts on the same page that are also showing percentages and I don't want them to. I've tried to disable the plug in for these charts as it says in the chartjs documentation but it doesn't seem to be working. What is the recommended way to disable this on specific charts?
I have a very similar issue. The ability to disable on some charts and also the ability to change the type from one chart to another. Here is an example:
When I set the Options.plugins.labels on one specific chart object it will set it for all chart objects.
When setting the labels to 'value' on customersThisWeek it will also set the labels to 'value' on customersThisMonth. I want to display the chart labels as 'values' on one chart and 'label' on another.
Help
Setting this will set the labels as 'value' for all charts on the page.
$scope.customersThisWeek.Options.plugins = { labels: { render: 'value' } }
Setting the labels as 'label', as below, has no affect. The customerThisMonth chart will also show as 'value'.
$scope.customersThisMonth.Options.plugins = { labels: { render: 'label' } }
Having same probnlem. Did you ever solve this issue?
I have not. Unfortunately, this has made this plug-in unusable for me.
I just simply disable the labels for the specific chart by setting the options.labels
to false. Hope this would help.
options: {
labels: false
}
Please refer to https://www.chartjs.org/docs/latest/developers/plugins.html#disable-plugins
plugins: {
labels: false
}
Originally posted by @emn178 in https://github.com/emn178/chartjs-plugin-labels/issues/76#issuecomment-434337977