0

I am using chart.js (v2.9.4) in an Angular Project and out-of-the-box when you click on an item in the legend it hides / shows the specific chart, which is of course very nice functionality!

But to make it more intuitive to the user that you can actually click on an item in the legend to show or hide an item, I would like to change the default color box for a toggle button.

I just have no idea if this is possible to do and if possible, where or how to do that? I can't find anything related to such functionality in the chart.js documentation.

Thanks for any help or advice!

Geoffrey
  • 23
  • 3

1 Answers1

0

You have to create your own HTML Legends.

Below listed answers may help you finding a solution for your case:

uminder
  • 23,831
  • 5
  • 37
  • 72
  • Thank you so much!!! That makes it quite easy actually!! How could I have overlooked this option! Now back to programming!! :D :D – Geoffrey Apr 27 '21 at 06:57