Charts > Using the Charts Library > Scales Display > Using Single Scale Displayers > Predefined Single Scale Displayers
 
Predefined Single Scale Displayers
The following sections describe the single scale displayers of the Charts Library. For each scale displayer, you will find a table that describes the conditions for using the scale displayer, including whether the scale displayer can be used whatever the type of the projection is and for which coordinate the scale displayer can be used.
You can find information on the following single scale displayers:
*Rectangular Scale Displayer
*Circular Scale Displayer
Rectangular Scale Displayer
A rectangular scale is a scale that has a straight line as an axis. A rectangular scale displayer allows you to display a rectangular scale. This type of scale displayer has the following basic characteristics:
Class
Category
Single
Can be used with all types of projections
Yes
Use
Used to display the scale representing:
  - The abscissa and ordinate coordinates
    in Cartesian charts.
  - The ordinate coordinates in polar charts.
Shape
Rectangular
The way the rectangular scales are positioned depends on the type of the projection. In Cartesian charts (using a Cartesian projection), they will be displayed orthogonally. In polar charts (using a polar projection), they will be displayed radially.
Figure 9.3 shows rectangular scales displayed by rectangular scale displayers in a Cartesian chart (using a Cartesian projection) and in a polar chart (using a polar projection).
Figure 9.3    Rectangular Scales Displayed by Rectangular Scale Displayers
We can use the rectangular scale that represents the ordinate coordinate in both charts as an example. We can create the scale displayer displaying this scale by using the following code:
IlvCoordinateInfo* coordInfo =
new IlvCoordinateInfo(IlvOrdinateCoordinate);
IlvRectangularScaleDisplayer* ordinateScaleDisplayer =
new IlvRectangularScaleDisplayer(coordInfo,
chart->getPalette());
ordinateScaleDisplayer->drawLabelOnCrossings(IlvTrue);
IlvConstantScaleStepsUpdater* updater =
new IlvConstantScaleStepsUpdater(ordinateScaleDisplayer);
delete IlvScaleStepsUpdater::Set(ordinateScaleDisplayer, updater);
updater->fixStepsCount(1, 0.1);
The coordinate information object associated with the coordinate that is represented by the scale is passed as a parameter to the constructor of the scale displayer. The palette that will be used to display the scale is set to the default palette of the chart.
The Boolean value indicating whether the step labels are drawn at the axes crossings is set to IlvTrue.
Then a constant scale steps updater is set on the scale, since we want steps and substeps with constant spacing, and finally we set a step unit of 1 and a substep unit of 0.1 on the scale steps updater.
Circular Scale Displayer
A circular scale is a scale that has a portion of a circle as an axis. A circular scale displayer allows you to display a circular scale. This type of scale displayer has the following basic characteristics:
Class
Category
Single
Can be used with all types of projections
No (Use only with a polar projection)
Use
Used to display the scale representing:
  - The abscissa coordinate in polar charts
Shape
Circular
A circular scale can be used only to represent the abscissa coordinate in polar charts. Figure 9.4 shows a circular scale displayed by a circular scale displayer in a polar chart (using a polar projection).
Figure 9.4    Circular Scale Displayed by a Circular Scale Displayer
We can use the circular scale representing the abscissa coordinate in the above chart as an example. We can create the scale displayer displaying this scale by using the following code:
IlvCoordinateInfo* coordInfo =
new IlvCoordinateInfo(IlvAbscissaCoordinate);
IlvCircularScaleDisplayer* abscissaScaleDisplayer =
new IlvCircularScaleDisplayer(coordInfo,
chart->getPalette());
abscissaScaleDisplayer->setMajorTickSize(12);
abscissaScaleDisplayer->setMinorTickSize(6);
abscissaScaleDisplayer->setStepLabelFormat("%.0f");
IlvConstantScaleStepsUpdater* updater =
new IlvConstantScaleStepsUpdater(abscissaScaleDisplayer);
delete IlvScaleStepsUpdater::Set(abscissaScaleDisplayer, updater);
updater->fixStepUnit(45.,5.);
The coordinate information object associated with the coordinate that is represented by the scale is passed as a parameter to the constructor of the scale displayer. The palette that will be used to display the scale is set to the default palette of the chart.
The size of the steps is set to 12 and the size of the substeps is set to 6. The format of the step labels is set to "%.0f". This means that the step labels will be drawn in the form of integer values.
Then a constant scale steps updater is set on the scale, since we want steps and substeps with constant spacing, and finally we set a step unit of 45 and a substep unit of 5 on the scale steps updater.

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