chartjs / chartjs-plugin-datalabels

Chart.js plugin to display labels on data elements
https://chartjs-plugin-datalabels.netlify.app
MIT License
874 stars 473 forks source link

Give the choice to display datalabels on 1 or all charts #335

Open alexandreszymkiw opened 2 years ago

alexandreszymkiw commented 2 years ago

Hello, I use this plugin with chartjs : is-it possible to developp this function : to have the possibly to display datalabels on 1 or all charts ? Because there are no options to display only one chart when we display 2 charts on the same chart. Thank you for your answer

LeeLenaleee commented 2 years ago

You can instead of registering the plugin globally by calling Chart.register(chartDatalabels) register it locally to the chart you want to display new Chart(ctx, {data, optsions, plugins: [chartDatalabels]}) or disable it in the config: new Chart(ctx, {data, options: {plugins: {datalabels: false}}})