In This Topic
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:
- The XAxis of the 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 below code shows how to Add XAxisTickMarks to the XAxis.
[Java]
Chart chart = new Chart(0, 0, 300, 200);
PlotArea plotArea = chart.getPrimaryPlotArea();
plotArea.getXAxes().getDefaultNumericXAxis().setMajorTickMarks(new XAxisTickMarks());
plotArea.getXAxes().getDefaultNumericXAxis().setMinorTickMarks(new XAxisTickMarks());
- 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 below code shows how to add YAxisTickMarks to the YAxis.
[Java]
Chart chart = new Chart(0, 0, 300, 200);
PlotArea plotArea = chart.getPrimaryPlotArea();
plotArea.getYAxes().getDefaultNumericYAxis().setMajorTickMarks(new YAxisTickMarks());
plotArea.getYAxes().getDefaultNumericYAxis().setMinorTickMarks(new YAxisTickMarks());
See Also