Chart for WinRT
Dependent Axis

The Axis.IsDependent allows you to link the auxiliary axis with one of the main axes (AxisX or AxisY, depending on AxisType). The dependent axis always has the same minimum and maximum as the main axis.

The Axis.DependentAxisConverter property and delegate Axis.AxisConverter specify the function that is used to convert coordinates from the main axis to the dependent axis.

The following code creates a dependent Y-Axis:

C#
Copy Code
c1Chart1.Reset(true); 
c1Chart1.Data.Children.Add(
   new DataSeries() { ValuesSource = new double[] { -10, 0, 10, 20, 30, 40 } });
c1Chart1.ChartType = ChartType.LineSymbols; 
Axis axis = new Axis() { AxisType = AxisType.Y, IsDependent =true};
// Celsius -> Fahrenheit
axis.DependentAxisConverter = (val) => val * 9 / 5 + 32;
c1Chart1.View.Axes.Add(axis);

 

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback