The documentation for the chart select event says
Information on the selected area can be found through event.xAxis and event.yAxis, which are arrays containing the axes of each dimension and each axis' min and max values. The primary axes are event.xAxis[0]…
I'm seeing a problem when dragging over multiple overlaid x axes. Nothing happens when the user releases the mouse button; mouse movement still drags the shaded selection rectangle. Clicking several times without releasing the mouse finally exits selection mode, but the event doesn't fire and no selection happens. HighStock throws an error
TypeError: Result of expression 'F.lin2val' [undefined] is not a function. (highstock.js:33)
The above quote is just intended to illustrate that the behavior is supported — the event callback in question never happens. However, the way we've been using it is to modify the parameter to strip out axes besides xAxis[0], since we only want to zoom the primary axis anyway. So the function is
- Code: Select all
selection: function( event ) { event.xAxis = event.xAxis.slice( 0, 1 ); }
It would be really nice if you could support this use case, in addition to fixing the bug. We can work around by manually re-implementing zoom on select for the primary axis. But this is the cleanest way to link several independent x axes together. If the primary axis changes for any reason besides user selection, for example the navigator or range selector, the other axes still adjust properly.
Here is a fiddle: http://jsfiddle.net/EYBXa/