c3js / c3

:bar_chart: A D3-based reusable chart library
http://c3js.org
MIT License
9.34k stars 1.39k forks source link

How to extend instead of override legend.item.onclick functionality #2662

Closed Sidharth1999 closed 5 years ago

Sidharth1999 commented 5 years ago

Hello!

So I love how you can toggle the visibility of certain data groups using the legend, but I'd also like to do some other things when a particular legend item is clicked.

However, when I provide a callback function to legend.item.onclick, I lose the original toggle functionality, which I'd like to preserve.

What's a simple way to extend the toggle functionality?

Thanks in advance!