Applies to

grAxis objects in Graph controls


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.


In a painter

To specify the type of unit to be used for rounding:

  1. Display the Axis tab page of the graph control's Properties view and select the desired axis from the Axis list.

  2. Turn on autoscaling by checking the AutoScale check box.

  3. Choose the datatype of the axis by selecting an option from the DataType drop-down list.

  4. 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:

gr_1.Values.DataType = AdtDate!
gr_1.Values.RoundToUnit = RndMonths!
gr_1.Values.RoundTo = 6