Using the Charts Library > Scales Display > Advanced Features for Customizing Scales > Defining the Minimum and Maximum Data Values Represented by a Scale
 
Defining the Minimum and Maximum Data Values Represented by a Scale
The minimum and maximum data values that are represented by a scale are stored in the coordinate information object associated with the coordinate represented by the scale.
This coordinate information object can be obtained by means of the getCoordinateInfo method of the scale displayer. It can also be accessed directly at the level of the chart without passing through the scale displayer. You can use the following methods to access the object at the level of the chart:
getAbscissaInfo for the abscissa coordinate
getOrdinateInfo for the ordinate coordinate(s)
By default, the minimum and maximum data values represented by a scale are computed automatically so that all the data points that are displayed by considering this scale can appear within the interval defined by the minimum and maximum data values. However, the minimum and maximum data values that are represented by a scale can be defined by using one of the following methods on the coordinate information object associated with the scale:
setUserDataMin
setUserDataMax
setUserDataRange
The minimum and maximum data values that are actually represented by a given scale, whether they are computed automatically or set by hand, are obtained by means of the following methods on the coordinate information object associated with the scale:
getDataMin
getDataMax
getDataRange
For example, the following code lines set 1 and 4 as the minimum and maximum data values represented by the main ordinate scale of a chart. This means that the data points that have to be displayed by considering this scale and that are outside of the interval defined by these minimum and maximum data values will not be displayed.
IlvAbstractScaleDisplayer* ordinateScale = chart->getOrdinateScale();
IlvChartCoordinateInfo* ordinateInfo = ordinateScale->getCoordinateInfo();
ordinateInfo->setUserDataRange(IlvCoordInterval(1, 4));

Version 5.5.1
Copyright © 2012, Rogue Wave Software, Inc. All Rights Reserved.