|
Default values for lowerLimit and upperLimit for SetLinear function |
Posted by Jhon on Apr-19-2013 15:54 |
|
Hi,
I want to know the default values for lowerLimit and upperLimit values If we are not provided any values for those in the SetLinearfunction of Chartdirector.
here my overloaded function:
void setLinearScale(double lowerLimit, double upperLimit, double majotTickInc)
Below are the my cases:
Case 1:
lowerLimit: provided
upperLimit: default value
majotTickInc : provided
Case 2:
lowerLimit: default value
upperLimit : provided
majotTickInc : provided
How Can I apply setLinear function for the above cases.
Thanks,
John |
Re: Default values for lowerLimit and upperLimit for SetLinear function |
Posted by Peter Kwan on Apr-20-2013 09:35 |
|
Hi John,
You can set the lowerLimit or upperLimit to Chart::NoValue if you want ChartDirector to automatically determine it. For example, you can set the lowerLimit to Chart::NoValue, and supply the upperLimit. ChartDriector will then automatically determine the lowerLimit. For example:
c->yAxis()->setLinearScale(Chart::NoValue, 8.8385);
ChartDirector will determine the lowerLimit and/or upperLimit based on many factors, such as the data values, how the values are combined, margins and extensions and the "zero affinity" (see Axis.setAutoScale), tick density (see Axis.setTickDensity), etc.. After ChartDirector has determined the axis scale, you may obtain it using Axis.getMinValue and Axis.getMaxValue.
Note that if your code does not provide both the lowerLimit and the upperLimit, it could not provide the majorTickInc. Any provided majorTickInc value would be ignored. Currently, ChartDirector will need the freedom to choose the tick increment in order to automatically determine the lowerLimit or upperLimit.
Also, note that if you do not provide the majorTickInc, ChartDirector may adjust the lowerLimit and upperLimit to align it with the majorTickInc it has chosen. For example, if the axis scale ends up being 0 to 8.833875287 (because the provided upperLimit is 8.833875287), and the tick increment is 2, ChartDirector may round the scale to 0 to 10, so that the axis end-points are at a labelled position. (This can be disabled using Axis.setRounding.)
Hope this can help.
Regards
Peter Kwan |
|