|
How to get the actual minimum and maximum values of the y and x-axis |
Posted by jaideep on May-15-2012 02:38 |
|
Hi,
I could not find this in the documentation, and maybe it is very easy to do.
In a chart (area or Scatter), once i set the scaling on the x-axis and other variables on the y-axis(like zero affinity etc), is there a way to get the actual start and end values that are being used for bot the x and y-axis?
Please let me know.
thanks,
Jaideep. |
Re: How to get the actual minimum and maximum values of the y and x-axis |
Posted by Peter Kwan on May-15-2012 05:55 |
|
Hi Jaideep,
After entering the data and configuring the chart, you may call XYChart.layoutAxes. ChartDirector will then compute the axis scale. You can then use Axis.getMinValue and Axis.getMaxValue to determine the axis scale.
For example, in C#:
... configure the chart as usual ....
c.layoutAxes();
double minYValue = c.yAxis().getMinValue();
double maxYVaule = c.yAxis().getMaxValue();
The getMinValue and getMaxValue returns the value as a double precision number. If you are expecting a DateTime, please use Chart.NTime to convert the number to DateTime.
Hope this can help.
Regards
Peter Kwan |
|