|
How to change the Y -axis display range |
Posted by steven ho on Jul-29-2016 10:07 |
|
Dear sir:
as pic
You can see the space below the layer in Y-axis is superfluous.
How can to fix it?
Thanks
|
Re: How to change the Y -axis display range |
Posted by Peter Kwan on Jul-29-2016 14:46 |
|
Hi Steven,
I assume you prefer the y-axis to start at somewhere like 8% instead of 0%.
By default, ChartDirector will start the axis from 0 if the data range (the difference between the max and min data values) is big relative to the data values. For example, f the data range is from 9.561 to 9.693, ChartDirector will not start the axis from 0. If the data range is from 9.2 to 13.1, ChartDirector will start the axis from 0. By default, the data range is big if it is at least 20% of the maximum data value. This is configurable using Axis.setAutoScale.
If you prefer not the start the axis from 0, you can use (in C++):
c->yAxis()->setAutoScale(0.05, 0.05, 0);
Hope this can help.
Regards
Peter Kwan |
Re: How to change the Y -axis display range |
Posted by steven ho on Aug-02-2016 09:06 |
|
Thank You
c.yAxis().setAutoScale(0.05, 0.05, 0)
↑
zeroaffinity -> can u tell me what' it??
Thank u so much |
Re: How to change the Y -axis display range |
Posted by Peter Kwan on Aug-02-2016 21:56 |
|
Hi Steven,
Zero affinity means the preference to include 0 in the axis. If the zero affinity is 1, that means the axis will always include 0. If the zero affinity is 0, that means there is no preference to include 0 in the axis.
By default, the zero affinity is 0.8, which means the axis will include 0 if the minimum data value is less than 0.8 of the maximum data value. For example, if the data range is 7 to 10, the axis will start from 0 (as the min value 7 is less than 0.8 x 10). If the data range is 9.853 to 10, the axis will not start from 0.
For your case, I assume you do not want to give any preference to 0, so I set the zero affinity to 0.
Hope this can help.
Regards
Peter Kwan |
|