Version

Configuring Axis Ranges in XamShapeChart

In the XamShapeChart control, both the axes are numeric. The range on these 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 underlying data. The range minimum is the lowest value of the axis. The range maximum is the highest value of the axis.

Overview

By default, the XamShapeChart control will calculate the minimum and maximum values for the X and Y axis range based on the lowest and highest data points in the underlying data source in order to maximize the chart plot area. This automatic calculation of an axis' minimum and maximum values may not be appropriate for your set of data points. For example, if you wanted to show some extra space between the edge of the chart and your plotted series, you would need to format the axis range in the XamShapeChart.

You can configure the ranges of axes by setting the following properties of the XamShapeChart control:

Property Name Property Type Description

double

Get or sets minimum value on an axis

double

Get or sets maximum value on an axis

Code Snippet

The following sample code demonstrates how to change the axis range on the X and Y axes of the XamShapeChart control.

In XAML:

<ig:XamShapeChart ItemsSource="{Binding}"
                  XAxisMinimumValue="0"
                  XAxisMaximumValue="100"
                  YAxisMinimumValue="0"
                  YAxisMaximumValue="100"/>

In C#:

var shapeChart = new XamShapeChart();
shapeChart.XAxisMinimumValue = 0;
shapeChart.XAxisMaximumValue = 100;

shapeChart.YAxisMinimumValue = 0;
shapeChart.YAxisMaximumValue = 100;

In VB:

Dim shapeChart = New XamShapeChart()
shapeChart.XAxisMinimumValue = 0
shapeChart.XAxisMaximumValue = 100

shapeChart.YAxisMinimumValue = 0
shapeChart.YAxisMaximumValue = 100

The above code will result in a XamShapeChart that looks like the following:

shapechart ranges.png