It is currently Sat Aug 02, 2014 4:26 am Advanced search

X-Axis min/max getting lost on redraw()

Technical support for the Highcharts Stock package

X-Axis min/max getting lost on redraw()

Postby linorosa » Thu Feb 09, 2012 10:02 pm

I'm trying to create a dynamic chart with fixed start-end timestamps. As the chart gets new data, it draws the lines from left to right without panning the screen.
However, I'm having a problem when adding points and calling chart.redraw(). My min/max options are being ignored and the chart zooms in. Am I missing any options?
linorosa
 
Posts: 5
Joined: Fri Jan 13, 2012 3:51 pm

Re: X-Axis min/max getting lost on redraw()

Postby linorosa » Thu Feb 09, 2012 11:47 pm

By the way, this only happens on HighStock. It works the way I want with Highchart
linorosa
 
Posts: 5
Joined: Fri Jan 13, 2012 3:51 pm

Re: X-Axis min/max getting lost on redraw()

Postby hfrntt » Mon Feb 13, 2012 3:03 pm

Hi sorry for late reply. Could you set up a demo to show us what exactly happens? You can use our jsbin: http://highcharts.com/jsbin/
Slawek Kolodziej
Highcharts support team
hfrntt
 
Posts: 6394
Joined: Mon Aug 30, 2010 10:41 am

Re: X-Axis min/max getting lost on redraw()

Postby linorosa » Mon Feb 13, 2012 9:26 pm

Sure, here's a couple of jsfiddle links

Just readjusting the handles or the zoom buttons ignores the min/max I've put on the xAxis and zooms in.
http://jsfiddle.net/linorosa/8fQGK/4/

Also happens if I add new data
http://jsfiddle.net/linorosa/yUMAW/1/
linorosa
 
Posts: 5
Joined: Fri Jan 13, 2012 3:51 pm

Re: X-Axis min/max getting lost on redraw()

Postby hfrntt » Sun Feb 19, 2012 10:23 pm

I suppose tha adding point causes Recalculation of axis extremes. Have you tried to use axis.setExtremes method? http://www.highcharts.com/stock/ref/#axis-object
Last edited by hfrntt on Sun Feb 26, 2012 8:56 pm, edited 1 time in total.
Slawek Kolodziej
Highcharts support team
hfrntt
 
Posts: 6394
Joined: Mon Aug 30, 2010 10:41 am

Re: X-Axis min/max getting lost on redraw()

Postby linorosa » Wed Feb 22, 2012 5:19 pm

Yes, I had to fall-back to setting extremes by myself. It works but I have to store the current extremes before redrawing.
linorosa
 
Posts: 5
Joined: Fri Jan 13, 2012 3:51 pm


Return to Highstock Usage

Who is online

Users browsing this forum: No registered users and 1 guest