Charts > Using the Charts Library > Scales Display > Advanced Features for Customizing Scales
 
Advanced Features for Customizing Scales
Several of the features for customizing scales cannot be made by simply setting properties on scales. These advanced features require you to specify certain settings on other objects of the chart. These advanced features are the following:
*Changing the Orientation of the Scales
*Defining the Minimum and Maximum Data Values Represented by a Scale
*Applying a Transformation to the Data Values Represented by a Scale
Changing the Orientation of the Scales
The scales of a chart can have different orientations depending on the type of the projection used for the chart. You specify the orientation of the scales by means of the projector object, which is responsible for the projection of the data points into screen coordinates. This object is an instance of the IlvCartesianProjector class for Cartesian charts and an instance of the IlvPolarProjector class for polar charts.
Changing the Scale Orientation for Cartesian Charts
The orientation of the scales for Cartesian charts is defined by a value of the type IlvCartesianProjector::Orientation that is set on the Cartesian projector. Any orientation that keeps the abscissa and the ordinate scales orthogonal can be used. Figure 9.5 shows these possible orientations.
Figure 9.5    Scale Orientation in a Cartesian Chart
By default, the scales orientation is set to IlvCartesianProjector::IlvXRightYTop. This means that the abscissa scale is oriented towards the right of the screen and the ordinate scales are oriented towards the top. To change the scales orientation, just call the setOrientation method of the Cartesian projector used in your Cartesian chart. For example, to change the scales orientation so that the abscissa scale is oriented towards the right of the screen and the ordinate scale is oriented towards the bottom, you can use the following code:
IlvCartesianProjector* projector
= (IlvCartesianProjector*)(chart->getProjector());
projector->setOrientation(IlvCartesianProjector::IlvXRightYBottom);
Changing the Scale Orientation for Polar Charts
The orientation of the abscissa scale for polar charts is determined by a flag at the level of the polar projector. This flag indicates whether the polar system of coordinates is oriented clockwise. The value of this flag is returned by the getOrientedClockwise method. By default, this flag is set to IlvFalse. This means that the abscissa scale will be oriented counterclockwise. You can change the orientation by means of the setOrientedClockwise method of the polar projector used in your polar chart. For example, to have the abscissa scale oriented clockwise, use the following code:
IlvPolarProjector* projector = (IlvPolarProjector*)(chart->getProjector());
projector->setOrientedClockwise(IlvTrue);
The orientation of the ordinate scale(s) for polar charts is not determined at the level of the projector. The orientation simply depends on the position of the ordinate scale(s) since they are displayed radially. For more information on how to position a scale, see Defining the Position of a Scale.

Version 6.0
Copyright © 2015, Rogue Wave Software, Inc. All Rights Reserved.