If i zoom an HighStock multi series chart (using either the Navigator or the Range Selector), is there a way to fetch the point.y data only for the zoomed series?
For example, if I am showing the sales information for a period across multiple branches (each branch plotted as series), and if zoomed to a week, I would like to know the total of sales for the week across the branches. Does highstock provide access to the zoomed dataset?
You can check
isInside
flag on every point:Live demo: http://jsfiddle.net/BlackLabel/7kmzhecy/
A very brute force approach to this is to loop over your data upon zooming and evaluate if it is visible. That is, is a given point within the range of the x-axis (and y-axis, if you allow zoom in that direction)?
See this JSFiddle demonstration of it in use.
You might evaluate
xAxis.events.setExtremes
, but it offersmin
andmax
values that might change after it takes effect, which might give some unexpected results.