We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
Is there any way to make the anchor/alignment/offset dynamic but fixed? Like make it a callback or something else?
I am setting up the position of labels in the chart but for some cases the position of labels is not perfect, like the 11% in the pic
The text was updated successfully, but these errors were encountered:
You can use scriptable options, for example (jsfiddle):
options: { plugins: { datalabels: { align: function(context) { return context.dataset.data[context.dataIndex] < 15 ? 'end' : 'start'; }, color: function(context) { return context.dataset.data[context.dataIndex] < 15 ? 'black' : 'white'; } // ... } } }
Sorry, something went wrong.
Thanks! It worked
I tried this way, maybe I missed a comma or other mistakes at that time.
No branches or pull requests
Hi,
Is there any way to make the anchor/alignment/offset dynamic but fixed? Like make it a callback or something else?
I am setting up the position of labels in the chart but for some cases the position of labels is not perfect, like the 11% in the pic
The text was updated successfully, but these errors were encountered: