Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alexandreszymkiw opened this issue Aug 23, 2022 · 1 comment
Open

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

alexandreszymkiw opened this issue Aug 23, 2022 · 1 comment

Comments

@alexandreszymkiw
Copy link

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
Copy link
Contributor

LeeLenaleee commented Sep 13, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants