New to Telerik UI for WinForms? Download free 30-day trial

Axis Alignment

The StartPositionAxis and the StartPositionValue properties of the abstract CartesianAxis class provide a functionality for fine positioning of the axes of a RadChartView.

  • StartPositionAxis: Defines the axis along which the current axis will be aligned.

  • StartPositionValue: Defines the location where the current axis should be positioned.

One Axis Offset

This example sets offset of the horizontal axis along the vertical axis.

One Axis Offset

LineSeries tempSeries = new LineSeries();
tempSeries.DataPoints.Add(new CategoricalDataPoint(-3, "Jan"));
tempSeries.DataPoints.Add(new CategoricalDataPoint(-2, "Feb"));
tempSeries.DataPoints.Add(new CategoricalDataPoint(2, "Mar"));
tempSeries.DataPoints.Add(new CategoricalDataPoint(7, "Apr"));
tempSeries.DataPoints.Add(new CategoricalDataPoint(12, "May"));
tempSeries.DataPoints.Add(new CategoricalDataPoint(18, "Jun"));
tempSeries.DataPoints.Add(new CategoricalDataPoint(20, "Jul"));
tempSeries.DataPoints.Add(new CategoricalDataPoint(20, "Aug"));
tempSeries.DataPoints.Add(new CategoricalDataPoint(16, "Sep"));
tempSeries.DataPoints.Add(new CategoricalDataPoint(10, "Oct"));
tempSeries.DataPoints.Add(new CategoricalDataPoint(5, "Nov"));
tempSeries.DataPoints.Add(new CategoricalDataPoint(0, "Dec"));
radChartView1.Series.Add(tempSeries);
CategoricalAxis tempHorizontalAxis = tempSeries.HorizontalAxis as CategoricalAxis;
tempHorizontalAxis.StartPositionAxis = tempSeries.VerticalAxis;
tempHorizontalAxis.StartPositionValue = 9;
tempHorizontalAxis.Title = "New York";
LinearAxis tempVerticalAxis = tempSeries.VerticalAxis as LinearAxis;
tempVerticalAxis.Title = " ºC";

Figure 1: One Axis Offset

WinForms RadChartView One Axis Offset

Two Axes Offset

This example sets offset offset of the two axes of the RadChartView.

Two Axis Offset

LineSeries cubicSeries = new LineSeries();
cubicSeries.DataPoints.Add(new CategoricalDataPoint(-27, -3));
cubicSeries.DataPoints.Add(new CategoricalDataPoint(-8, -2));
cubicSeries.DataPoints.Add(new CategoricalDataPoint(-1, -1));
cubicSeries.DataPoints.Add(new CategoricalDataPoint(0, 0));
cubicSeries.DataPoints.Add(new CategoricalDataPoint(1, 1));
cubicSeries.DataPoints.Add(new CategoricalDataPoint(8, 2));
cubicSeries.DataPoints.Add(new CategoricalDataPoint(27, 3));
radChartView1.Series.Add(cubicSeries);
CategoricalAxis cubicHorizontalAxis = cubicSeries.HorizontalAxis as CategoricalAxis;
cubicHorizontalAxis.StartPositionAxis = cubicSeries.VerticalAxis;
cubicHorizontalAxis.StartPositionValue = 0;
LinearAxis cubicVerticalAxis = cubicSeries.VerticalAxis as LinearAxis;
cubicVerticalAxis.StartPositionAxis = cubicSeries.HorizontalAxis;
cubicVerticalAxis.StartPositionValue = 0;

Figure 2: Two Axis Offset

WinForms RadChartView Two Axis Offset