Reputation: 145
I added the labels on vue pie chart using vue-chartjs and chartjs-plugin-labels module. But they are displayed on all charts. I want to display the labels on only specific chart. How can I do it?
Upvotes: 0
Views: 710
Reputation: 31439
If you dont register it globally but only locally in the plugins array it will only activate for that chart
Example (only the first chart will have labels):
var chart = {
type: 'pie',
plugins: [chartjsPluginDatalabels],
data: {},
options: {}
var chart2 = {
type: 'pie',
plugins: [],
data: {},
options: {}
Codepen live example: https://codepen.io/leelenaleee/pen/yLgmmyd
Upvotes: 1