$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Chart Control for C# Windows Forms
Design Bar, Pie, Line, Area, Polar, Radar and Scatter for C# Windows Forms application
Home > WinForms UI Controls > User Manual > Chart Axes Linear in C#

Linear Axes in Chart for WinForms C# Tutorial

Axes can be used to represent the collection of Linear that are able to plot the numeric data in the Cartesian Area. The Linear axes are used to plot numeric data in Chart. It is valid only in the context of Cartesian Area and is created when adding Bar, Line, Area and Scatter series. The Linear Axes calculate the value to the properties of Max, Mini and MainStep automatically in according to input data.

Properties of the Linear Axis.

  • ValidRange , this is a property used to set the valid range of mini and maximum value to plan data.
  • DesiredTickCount , this is a property used to set the number of ticks on the axis.
  • Mini , the property is used to set the minimum value of the axis.
  • Max , this is a property used to set the user-defined maximum of the axis.
  • MainStep , this is a property used to set the property of the main step between each axis tick. The default value of the axis will compute the major step automatically based on the planed data.
  • RangeExtendDirection , the property is used to set the value to specify the automatic extended range of the axis. Its valid values include None, Positive, Negative, and Both.
  • HPosition , the property is used to fix the position of the horizontal place of the axis against the plot area. Its valid values include Top and Bottom
  • VPosition , the property is used to fix the position of the vertical place of the axis in against the plot area. Its valid values include Left and Right.
In addition, Linear Axis is not the default to Cartesian series. As the descendant of Axis, it will inherit all properties of the Axis class. Developers need to create an instance of the property and assign Linear Axis to the series. The below C# code shows the steps.

ScatterSeries series = new ScatterSeries();
series.DataPoints.Add(new ScatterDataPoint(4, 7));
series.DataPoints.Add(new ScatterDataPoint(5, 8));
series.DataPoints.Add(new ScatterDataPoint(-3, 5));
series.DataPoints.Add(new ScatterDataPoint(15, 7));
chart1.Series.Add(series);

LinearAxis horizontalAxis = chart1.Axes.Get<LinearAxis>(0);

horizontalAxis = series.HorizontalAxis as LinearAxis;
horizontalAxis.Mini = -7;
horizontalAxis.Maxi = 13;
horizontalAxis.MainStep = 8;

LinearAxis verticalAxis = chart1.Axes.Get<LinearAxis>(1);

verticalAxis = series.VerticalAxis as LinearAxis;
verticalAxis.Mini = 3;
verticalAxis.Max = 9;
verticalAxis.MainStep = 5;
verticalAxis.HPosition = AxisHPosition.Right;
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls