Dundas Chart for SharePoint Send comments on this topic.
Using Axis Scale And Interval
See Also

Glossary Item Box

Overview

An axis scale not only dictates the values present on the axis that it represents, but it is also responsible for the behavior of other elements used in the chart. This is especially true in stacked, or 100% stacked chart types, but its presence is not diminished in other chart types too. This topic discusses how to work with axis scales when using Dundas Chart for SharePoint™.

Automatic Scaling

Both the Minimum and Maximum axis properties can be set to a specific value, or they can be set to Auto, which is the default. If the minimum and maximum values are set to Auto, then depending on the axis, automatic scaling will determine their values from X or Y data point values.

If the Margin property is set to True, which is its default, then automatic scaling will add a "gap" or an axis margin between the last data point and the border of the chart area. The size of this margin is determined automatically.

Setting The Axis Interval

Both axes and their associated grid lines, tick marks, and labels have Interval, IntervalOffset, IntervalType, and IntervalOffsetType properties.

The properties of the axis elements (e.g. major grid lines, etc.) are given higher priority as compared to the Axis properties. For example, if the Axis.Interval is five, and the Interval of a major grid line is three, then a value of three will be used for that major grid line's interval.

The minor grid lines and tick marks of an axis never have their interval-related properties affected by the property settings of the parent Axis object.

By default, an Axis object's interval-related properties are all set to Auto, while the interval-related properties of its associated major grid lines, major tick marks, and labels are set to NotSet. When an axis element, such as a major grid line, has its interval offset or not set, the value used for that property is taken from the Axis object.

To override this behavior you can set an interval-related property of a grid line, tick mark, or axis label to a value other than NotSet. For example, you could use the Interval, IntervalType, IntervalOffset, and IntervalOffsetType properties of the MajorGrid, MinorGrid, MajorTickMark, MinorTickMark, or LabelStyle object properties of an axis.

To set the IntervalType and IntervalOffsetType properties to NotSet, use DateTimeIntervalType.NotSet. Note that the Axis object cannot have these properties set to NotSet. To set these properties to Auto, use a value of DateTimeIntervalType.Auto.

To set the Interval and IntervalOffset properties to NotSet, use a Double.NaN value (not applicable to the Axis object). To set these properties to Auto, use a value of zero.

For more information about grid lines, and tick marks, see the topic on Grid Lines and Tick Marks.

 

Note
By default, major grid lines, major tick marks, and labels are enabled if the axes are also enabled. In this case, their interval-related properties are calculated automatically. If the XValueType, or YValueType properties of the first series (that uses an axis) is DateTime, then the interval type for grid lines, tick marks, and labels of that axis will always be calculated automatically, regardless of the IntervalType setting.

 

When Axis.Interval is set to Auto, the IntervalAutoMode property determines how many intervals should be calculated. If your chart is being resized or redrawn often, you can set the IntervalAutoMode property to VariableCount, in which case the Chart will dynamically calculate axis intervals. This is especially useful in situations where the chart intervals are displayed differently depending on their data.

Value axes can be either linear, which is the default, or logarithmic depending on the Logarithmic property setting.

 

Note
Setting a categorical axis to logarithmic will result in an exception being thrown.

See Also