I want do something when I change the zoom if highstock.
I can listen the redraw event then I kown its changed, but how can i get the zoom infomation?
You can catch setExtremes() event http://api.highcharts.com/highstock#xAxis.events.setExtremes and afterSetExtremes http://api.highcharts.com/highstock#xAxis.events.afterSetExtremes
Related
I want to disable the chart Redraw event which happens after the setExtremes event . I am talking about even after disabling the liveRedraw ,the chart executes the setExtremes on mouseup after leaving the navigator , then immediately executes the redraw.
I am trying to show a loader on the screen in the setExtremes call but the loader does not appear on the screen. On profiling the same it looks like the paint function to draw on the screen is called only after the Redraw event has finished.
I’d say the flow should be
SetExtremes :
ShowLoader ()
The loader should now appear on the screen while the chart continues to render the data points then eventually call the Redraw event and then the loader will be hidden after the Redraw event.
I am trying to do the same as regular zooming, but I use:
events : { selection : function(event) {
instead of the regular zooming (it is part of something --> Launch Highcharts zooming programmatically (after a selection))
The problem. When I select (via selection, like zooming) an interval (for example something between 00:00 and 01:00) the zoom shows another area. How can I solve this?
http://jsfiddle.net/FSfR2/4/
You've overcomplicated your problem, just pass the min and max you get in the event to the setExtremes function
chart.xAxis[0].setExtremes(event.xAxis[0].min, event.xAxis[0].max);
http://jsfiddle.net/bhlaird/wmyM4/
By default, the tooltip appears as soon as the cursor enters the chart. I would like to control when it first appears in one of two ways:
Wait for user to hover over (around) a data point on the chart.
This way the user can look at the entire chart without the
distraction of the tooltip.
mousedown - is there a way to disable the default mousedown function
and use it for displaying the tooltip instead? And because the
tooltip and crosshair seem to be joined, perhaps the same mousedown
event could fire the crosshair to appear?
number 2 would be best; any suggestions/solutions would be appreciated!
Number 2 is possible to achieve by:
disable default Highcharts tooltip
create point.click event handler
in above handler, create your own tooltip (it's simple div with some CSS)
make proper position for tooltip (accessed via this.point.plotX and this.point.plotY
Is there a way to get noticed when a chart is redrawn after the window size changed. Listen to the window change event itself is not a good idea cause I cant rely on which event if is fired first the one that is redrawn the graph or mine.
The chart redraw event fires when the chart div resizes http://api.highcharts.com/highcharts#chart.events.redraw
events: {
redraw: function () {
alert("redrawing chart");
}
}
Note, this fires for other reasons as well e.g. when you add a datapoint, or modify series options etc.
Is it possible to add a drag-end event on the navigator handles? Because I would get the actually navigator selection from a chart
Take a look on official highstock demo. You need to hook a setExtremes event on xAxis, and check for (event.trigger == 'navigator').
Hope this helps.