Version

Configuring Axis Scales

Overview

This topic covers the different scaling modes of the axes of the XamShapeChart control, and is organized as follows:

Introduction

In the XamShapeChart control, both axes are numeric and allow scaling of data values using built-in scalers. This can be set by setting the IsLogarithmic property for each axis in the chart. Setting this property effectively sets the axis scaler to a linear or logarithmic mode for the particular axis it is set on.

Properties

The following table lists the properties that affect the scale of the axes in the XamShapeChart control.

Axis Property Property Type Description

XAxisIsLogarithmic,
YAxisIsLogarithmic

bool

Gets or sets whether or not to set a particular axis to scale its data items to a logarithmic plot. While this property is false, a linear scale will be used for the corresponding axis.

XAxisLogarithmBase,
YAxisLogarithmBase

int

Gets or sets the base value to use in the log function when mapping the position of data items along the corresponding numeric axis. This property is only effective if the corresponding "IsLogarithmic" property for the axis is set to true.

Code Example

The following code snippet shows how to use the built-in axis scalers to scale data values plotted in the XamShapeChart control:

In XAML:

<ig:XamShapeChart x:Name="shapeChart"
                  ItemsSource="{Binding Data}"
                  XAxisIsLogarithmic="True"
                  XAxisLogarithmBase="2"
                  YAxisIsLogarithmic="True"
                  YAxisLogarithmBase="2" />

In C#:

shapeChart.XAxisIsLogarithmic = true;
shapeChart.XAxisLogarithmBase = 2;
shapeChart.YAxisIsLogarithmic = true;
shapeChart.YAxisLogarithmBase = 2;

In Visual Basic:

shapeChart.XAxisIsLogarithmic = True
shapeChart.XAxisLogarithmBase = 2
shapeChart.YAxisIsLogarithmic = True
shapeChart.YAxisLogarithmBase = 2

Using the above code will result in a XamShapeChart that looks like the following when using an exponential, linear, quadratic, and logarithmic set of data items:

shape-chart-axis-scales.png