Hi Bill,
The method is Axis.setLinearScale. For example:
//Sets the minimum value to 10. The maximum value is automatically determined.
c.yAxis().setLinearScale(10, Chart.NoValue);
If you do not use the above method, ChartDirector will automatically determine both the minimum and maximum values of the y-axis based on your data. It may or may not choose 0 as the minimum value. It depends on your data.
However, ChartDirector does have a preference to choose 0. It occurs if your data fluctuation is not small. For example, if your data are from 93 to 97, ChartDirector probably will not start the axis from 0. If your data are from 31 to 157, ChartDirector probably will start the axis from 0. This is configurable using the "zeroAffinity" parameter in Axis.setAutoScale. By default, the zeroAffinity is 0.8, meaning that if the minimum data value is less than 0.8 of the maximum data value, the axis will start from 0.
If you want the minimum value to be automatically determine by ChartDirector, but does not want ChartDirector to give a special preference to 0, you may use:
c.yAxis().setAutoScale(0.05, 0.05, 0);
Hope this can help.
Regards
Peter Kwan |