To improve the interactivity and responsiveness of charts, it would be great to be able to attach event handlers to the following events:
-
Legend item double click – So far the legend API allows to attach event handler to item click, mouseover, mouseout, and mousemove. It would be great if I could attach a handler to the double click event. At the moment, I am hiding/showing a series whenever a user clicks on a legend item. In addition to that, I would like to allow the user to double click a legend item in order to hide all series except for the double clicked one.
-
Resize events – I really like your automatic handling of window resizing. However, there are often cases where I would like to modify the chart before it is re-rendered.
-
Example: the window size changes and based on the window size, I would like to exclude some data points.
-
Of course, I could register a resize listener to the window object myself and re-render the chart accordingly, but this could interfere with the automatic re-rendering and may result in rendering twice.
-
It would be much more convenient to have an event handler
onBeforeResize
which is invoked before the chart is re-rendered. In this event handler I could modify the complete chart before your automatic re-rendering takes place.
-
Maybe some developers are also interested in an
onAfterResize
hook.