This document provides a brief overview of a visual range and a whole range, and also details how to change the range of axis coordinates, therefore limiting or increasing the volume of data represented by an associated series.
For the purpose of simplicity, this document will use the most common diagram type - an XY-diagram.
Note that before reading this topic, it may be useful to review the basics of using axes in the ASP.NET Chart Control.
The axis range is represented by the whole range and visual range.
The whole range determines the overall range of series associated with the axis, while visual range determines the axis range of values displayed on a single screen. The visual range can be less than or equal to the whole range. So, changing the visual range does not affect the whole range. If the maximum or minimum value of the series extends beyond the visual range, the chart's series will partially (or completely) fall out of the diagram.
To define an axis range, change the minimum and maximum values of the whole range. In this case the visual range will be equal to the whole range.
The following table shows this behavior for the X-axis.
Visual Range is equal to Whole Range
Visual Range is less than Whole Range
The axis range can be defined for all existing diagram types, with the exception of the Simple and Simple 3D diagrams, since they do not have axes.
When the Qualitative and DateTime scale types are used for an axis (more on this at Axis Scale Types), XtraCharts recalculate maximum and minimum range values into float numbers internally. These float representations are available from the Range.MinValueInternal and Range.MaxValueInternal properties.
In addition, you can determine whether side margins should be maintained before and after the maximum and minimum axis values defined by the axis range. This way, you will not have to worry about showing the outermost points of an associated series at the diagram's edge. To accomplish this, set the Range.AutoSideMargins to true. You can specify custom side margins using the Range.SideMarginsValue property. This resets the Range.AutoSideMargins property.
The sections below detail how to customize visual range and whole range individually.
The visual range is represented by the VisualRange object and can be accessed from the AxisBase.VisualRange property. The visual range (as well as the whole range) is defined by the Range.MaxValue and Range.MinValue property values, which are calculated automatically, since the Range.Auto property of the axis is enabled by default. However, you can customize these properties as your needs dictate.
The visual range does not affect the whole range. If you wish to extend an axis range beyond its default bounds, change the AxisBase.WholeRange property first. After that you can determine which part of the entire range should be shown on a single screen by specifying the AxisBase.VisualRange property.
The following image demonstrates the available axis range options and the appearance of a chart, when its Range.Auto property is set to true.
When the visual range is set to Auto, its minimum and maximum axis values are calculated automatically, based on the whole range values. So, to define an axis range in Auto mode, you should change the minimum and maximum values of the whole range.