Tick Marks

TickMarks are small vertical and horizontal lines of measurement that intersect the XAxis and the YAxis respectively. They are added in conjunction with the Grid Lines. If the charts AutoLayout property is set true, Tick Marks are displayed automatically. There are two different types of tick marks, XAxisTickMarks and YAxisTickMarks.

XAxisTickMarks

The XAxis of a chart uses XAxisTickMarks. MajorTickMarks are drawn for each MajorGridLines and MinorTickMarks are drawn for each MinorGridLines on the XAxis. By default the XAxisTickMarks are turned on. The position of XAxisTickMarks is decided by XAxisTickMarkPosition enumeration. The default position and size of XAxisTickMarks is below the XAxis and four respectively. The default size of MinorTickMarks is two. By default the interval between MajorTickMarks is the interval for the XAxis and the interval for MinorTickMarks is half the interval of the XAxis.

The following code shows how to Add XAxisTickMarks to the XAxis.

Chart chart = new Chart(0, 0, 300, 200);
PlotArea plotArea = chart.PrimaryPlotArea;  
plotArea.XAxes.DefaultNumericXAxis.MajorTickMarks = new XAxisTickMarks();
plotArea.XAxes.DefaultNumericXAxis.MinorTickMarks = new XAxisTickMarks();         
Dim MyChart As Chart = New Chart(0, 0, 300, 200)
Dim MyPlotArea = MyChart.PrimaryPlotArea
MyPlotArea.XAxes.DefaultNumericXAxis.MajorTickMarks = New XAxisTickMarks()
MyPlotArea.XAxes.DefaultNumericXAxis.MajorTickMarks = New XAxisTickMarks()  

YAxisTickMarks

The YAxis of the chart uses YAxisTickMarks. MajorTickMarks are drawn for each MajorGridLines and MinorTickMarks are drawn for each MinorGridLines on the YAxis. By default the YAxisTickMarks are turned on. The position of YAxisTickMarks is decided by YAxisTickMarkPosition enumeration. The default position and size of YAxisTickMarks is to the left the YAxis and four respectively. The default size of MinorTickMarks is two. By default the interval between MajorTickMarks is the interval for the YAxis and the interval for MinorTickMarks is half the interval of the YAxis.

The following code shows how to add YAxisTickMarks to the YAxis.

Chart chart = new Chart(0, 0, 300, 200);
PlotArea plotArea = chart.PrimaryPlotArea;
plotArea.YAxes.DefaultNumericYAxis.MajorTickMarks = new YAxisTickMarks();
plotArea.YAxes.DefaultNumericYAxis.MinorTickMarks = new YAxisTickMarks();        
Dim MyChart As Chart = New Chart(0, 0, 300, 200)
Dim MyPlotArea = MyChart.PrimaryPlotArea
MyPlotArea.YAxes.DefaultNumericYAxis.MajorTickMarks = New YAxisTickMarks()
MyPlotArea.YAxes.DefaultNumericYAxis.MajorTickMarks = New YAxisTickMarks()

In this topic