chartjs-plugin-labels icon indicating copy to clipboard operation
chartjs-plugin-labels copied to clipboard

Can't disable for specific charts

Open BrotherZach opened this issue 3 years ago • 5 comments

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?

BrotherZach avatar May 07 '21 13:05 BrotherZach

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' } }

BrettBurbidge avatar May 29 '21 00:05 BrettBurbidge

Having same probnlem. Did you ever solve this issue?

robel93 avatar Jul 21 '21 11:07 robel93

I have not. Unfortunately, this has made this plug-in unusable for me.

BrotherZach avatar Jul 21 '21 17:07 BrotherZach

I just simply disable the labels for the specific chart by setting the options.labels to false. Hope this would help.

options: {
  labels: false
}

DoubleE1 avatar Jan 11 '22 04:01 DoubleE1

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

beaver71 avatar Feb 01 '22 13:02 beaver71