RoundToUnit property for PowerScript controls
Controls
grAxis objects in Graph controls
Description
When the AutoScale property is enabled, the RoundTo and RoundToUnit properties
specify how to round the end points and tick marks of an axis. Rounding
affects axis labels, not graph data.
The RoundToUnit property specifies the type of units that
should be used for the rounding. The type of units that can be specified
are based on the datatype of the axis. For example, for a date axis,
you might round tick marks to the nearest five years or to every
third month.
Usage
In a painter
To specify the type of unit to be used for rounding:
-
Display the Axis tab page of the graph
control’s Properties view and select the desired axis from
the Axis list. -
Turn on autoscaling by checking the AutoScale
check box. -
Choose the datatype of the axis by selecting an
option from the DataType drop-down list. -
Choose the desired unit from the RoundToUnit drop-down
list.
In scripts
The RoundToUnit property takes a value of the enumerated datatype grRoundToType.
When you set this property in scripts, make sure the value is compatible
with the datatype of the axis.
The following example sets the datatype of the Values axis
to date and then sets the unit for rounding to months and the number
of months to which to round:
1 |
gr_1.Values.DataType = AdtDate! |
1 |
gr_1.Values.RoundToUnit = RndMonths! |
1 |
gr_1.Values.RoundTo = 6 |