I want to display multiple years of historical stock data in a HighChart. The json data size for all the years is 5mb, why I want to avoid loading all at once. Especially because most users will only need the last 6 month.
I would like to fetch the first 6 months initially. If the user zooms out or "moves" backwards in time I would like to load the whole data. Has someone a recipe for this? What is the starting point? Are there any HighChart events I could listen to, to get notified when the user zooms out or moves?
You are looking for the xAxis.events.setExtremes
event.
You will need to combine it with Series.addPoint(Object options, [Boolean redraw], [Boolean shift], [Mixed animation])
inside a loop with the redraw option as false inside the it and explicitly call Chart.redraw()
after looping all the newly added points.
You may also need to look @ navigator.series
since your navigator series may require to be different from the actual series
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With