|
Is it possible to have linear scale axis bound on one end while leaving the other end unbound? |
Posted by Geoff Groskreutz on Feb-19-2013 09:02 |
|
What I mean, is there a way to set the linear scale, so that one end is fixed (using some number), but the other end is unbound/autosized (maybe using the No Value constant) and uses the existing auto-sizing logic only for this end of the linear scale?
So, something like:
// y-axis scale unbound to 100, with a label every 10 units, this would use 10 as the unit and use the auto-scale, but would fix the top of the scale at 100
c.yAxis().setLinearScale(Chart.NoValue, 100, 10);
// y-axis scale 50 to unbound, with a label every 10 units, this would use 10 as the unit and use the auto-scale, but would fix the bottom of the scale at 50
c.yAxis().setLinearScale(Chart.NoValue, 100, 10);
//Or, for any auto unit scale, and one side unbound, this would use the same logic as auto-unit and auto-scale, but fix the top end of the scale at 100
c.yAxis().setLinearScale(Chart.NoValue, 100, Chart.NoValue); |
Re: Is it possible to have linear scale axis bound on one end while leaving the other end unbound? |
Posted by Peter Kwan on Feb-19-2013 22:59 |
|
Hi Geoff,
Yes. You should be able to fix only one of the ends. For example:
c.yAxis().setLinearScale(Chart.NoValue, 100);
The above code should fix the upper range of the y-axis to 100, with the lower range automatically determined by ChartDirector.
Hope this can help.
Regards
Peter Kwan |
Re: Is it possible to have linear scale axis bound on one end while leaving the other end unbound? |
Posted by Geoff Groskreutz on Feb-21-2013 03:44 |
|
Yes, this works, we also found that we needed to use the setAutoScale method as well, to adjust the top margin to prevent the scale from being increased when the padding is added to the top by default, and then adjust the zero affinity (to me much smaller), so that the zero value is not always displayed. Note: We are using this primarily for percentage data (eg. values between 0 and 1).
Thanks,
Geoff |
|