It is currently Sun Oct 26, 2014 3:47 am Advanced search

setExtremes on chart.load

Technical support, bug reports and more.

setExtremes on chart.load

Postby kzoon » Mon Sep 19, 2011 12:49 pm

I want to determine y-axis min and max during the loading of a chart (I need this to create a bubble chart where the average bubble radius is related to PlotWidth and PlotHeight, so big charts get bigger bubbles and small charts get smaller bubbles).

I use axis.setExtremes during the load event of chart. The new maximum is set correctly, but the axis scaling is distorted see http://jsfiddle.net/kzoon/h7Xhk/. This problem only happens when chart animantion is false.

Any ideas?
kzoon
 
Posts: 155
Joined: Wed Aug 10, 2011 10:22 am

Re: setExtremes on chart.load

Postby hfrntt » Wed Sep 21, 2011 11:39 am

Instead of using setExtremes you can set axis min and max, see: http://jsfiddle.net/hfrntt/h7Xhk/4/
Slawek Kolodziej
Highcharts support team
hfrntt
 
Posts: 6394
Joined: Mon Aug 30, 2010 10:41 am

Re: setExtremes on chart.load

Postby kzoon » Wed Sep 21, 2011 12:13 pm

hfrntt,
thanks for your reply.
I connot set min/max in the options, because I need to know PlotWidth and PlotHeight before I can calculate my min and max values. That is why I want to use setExtremes during the load event of chart.

Is the scale distortion a bug, or can't I use axis.setExtremes during chart load?
kzoon
 
Posts: 155
Joined: Wed Aug 10, 2011 10:22 am

Re: setExtremes on chart.load

Postby hfrntt » Thu Sep 22, 2011 11:31 am

You can use setExtremes in chart.load, but as you can see, if you disable animations some axis lines won't be redrawn properly (as in your example). Anyway, in your case I advice to use setExtreme, then call redraw and instead of disabling animation, set its duration to 0.

See: http://jsfiddle.net/hfrntt/h7Xhk/5/
Slawek Kolodziej
Highcharts support team
hfrntt
 
Posts: 6394
Joined: Mon Aug 30, 2010 10:41 am

Re: setExtremes on chart.load

Postby kzoon » Fri Sep 23, 2011 11:22 am

Thanks very much for the duration=0 suggestions; it works very well!
kzoon
 
Posts: 155
Joined: Wed Aug 10, 2011 10:22 am


Return to Highcharts Usage

Who is online

Users browsing this forum: No registered users and 7 guests