ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  How to set minimum y axis value that is greater than zero?
Posted by Bill on Jan-05-2012 20:15
Hi peter,
  Let me know how to set a minimum value of y axis value greater than zero? Tia

  Re: How to set minimum y axis value that is greater than zero?
Posted by Bill on Jan-05-2012 20:16
Btw im using asp.net using c#.net

  Re: How to set minimum y axis value that is greater than zero?
Posted by Peter Kwan on Jan-06-2012 01:01
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

  Re: How to set minimum y axis value that is greater than zero?
Posted by Bill on Jan-06-2012 04:38
Thanks a lot Peter. This will make our graph for yield more presentable.