I need to modify click event on highcharts legend items. Highcharts demo http://www.highcharts.com/demo/line-basic . I want for example: first action will be some alert and second action will be action by default(clean Tokyo line from chart). Thanks. Sorry if question not clean.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
You have to use the
legendItemClick
callback like the following codeHere is working fiddle which shows alert when you click on legends like on Tokyo and then hide Tokyo line.
See also the plotOptions documentation for the event in question. Where you need to place this may differ depending on what chart type you are using.
For me, the legendItemClick event had to be for the series, not the line. E.g.:
Example from Highcharts: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/series-events-legenditemclick/