Add a mouseOver delay
I would like to be able to set a delay for mouseOver event firing. Currently, the mouseOver event fires immediately resulting in multiple firings as the cursor is dragged across a chart. For mouseOver event functions that require some time to process the results can look choppy and confusing. This would be especially nice for heatmaps where central points cannot be reached without mousing over other points.
-
Almed Batlex commented
Agreed, a built-in delay would make a real difference, because a mouseOver that fires on every point as the cursor crosses a heatmap makes expensive handlers feel choppy. Until it exists, a common workaround is to debounce the handler so it only runs after the cursor has rested on a point for roughly 100 to 200 milliseconds, and to cancel the pending call when the mouse leaves. If you end up building a reusable interaction method for charts that others could use, it may be worth reading how a page like https://sherinianlaw.net/patent-attorney-chicago-il/ approaches software inventions before you publish it. Thanks for describing the heatmap case so clearly, since reaching central points without triggering every neighbor is exactly where this hurts.
-
The typical implementation would be that you set a timeout in the mouseOver event, and clear the timeout in mouseOut.
- Original, without delay: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/series-point-events-mouseover/
- Modified, with delay: http://jsfiddle.net/highcharts/9so4xkd0/