Version

Configuring Axis Range

In the XamDataChart™ control, the range on numeric axes is the difference in numeric values from the beginning of the axis to the end or from the smallest to largest values in the data. The range minimum is the lowest value of the axis. The range maximum is the highest value of the axis.

By default, the XamDataChart control will calculate the minimum and maximum values for the axis range based on the lowest and highest data points in order to maximize the chart plot area. The automatic calculation of an axis' minimum and maximum values may not be appropriate for your set of data points. For example, if your data has a minimum value of 850, you may want to set the minimum value of the axis using axis’s MinimumValue property to 800 so that there will be a space value of 50 between the axis minimum and the lowest value of data points. The same can be applied to the axis maximum value and the highest value of data points using axis’s MaximumValue property.

The following sample code demonstrates how to change the axis range on NumericYAxis.

In XAML:

<ig:NumericYAxis x:Name="yAxis"
                MinimumValue="500"
                MaximumValue="1300"
                Interval="100">
</ig:NumericYAxis>

In C#:

var yAxis = new NumericYAxis()
{
    MinimumValue = 500,
    MaximumValue = 1300,
    Interval = 100
};

In Visual Basic:

Dim yAxis As New NumericYAxis()
yAxis.MinimumValue = 500
yAxis.MaximumValue = 1300
yAxis.Interval = 100

The following images shows how the XamDataChart control might look like with axis range set on NumericYAxis.

xamDataChart Axis Range 01.png