Skip to content
Advertisement

How to display legend in toolbox in Charts.js?

I created a scatter chart by using charts.js in my Django project. It is working clearly but in the toolbox, the legends name does not show just number is displaying. How can I display it?

my chart

I want to display it as: Argentina(44015314.68,28)

my code:

JavaScript

Advertisement

Answer

You can achieve this by using a custom callback to alter the text of the tooltip like so:

JavaScript

Working example:

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement