Axis.MajorTickMarks Property
Gets or sets the position of major tick marks on the axis.
Namespace: DevExpress.Spreadsheet.Charts
Assembly: DevExpress.Spreadsheet.v24.2.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
Declaration
Property Value
Type | Description |
---|---|
AxisTickMarks | An AxisTickMarks enumeration value that specifies how major tick marks are displayed on the axis. |
Available values:
Name | Description |
---|---|
Cross | Specifies that the tick marks should cross the axis. |
Inside | Specifies that the tick marks should be displayed inside the plot area. |
None | Specifies that the tick marks should not be displayed on the axis. |
Outside | Specifies that the tick marks should be displayed outside the plot area. |
Remarks
Tick marks are tiny lines that are used to indicate the demarcation of the axis. Use the MajorTickMarks property to specify how major tick marks appear: whether they are displayed inside or outside the plot area, whether they cross the axis, or if they are completely hidden.
You can also use the Axis.MinorTickMarks property to add minor tick marks to the axis.
Example
The example below demonstrates how to create the clustered column chart and hide the axis major tick marks by setting the Axis.MajorTickMarks
property to the AxisTickMarks.None value.
Worksheet worksheet = workbook.Worksheets["chartTask3"];
workbook.Worksheets.ActiveWorksheet = worksheet;
// Create a chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet["B3:C5"]);
chart.TopLeftCell = worksheet.Cells["H2"];
chart.BottomRightCell = worksheet.Cells["N14"];
// Set the axis tick marks.
Axis axis = chart.PrimaryAxes[0];
axis.MajorTickMarks = AxisTickMarks.None;
axis = chart.PrimaryAxes[1];
axis.MajorTickMarks = AxisTickMarks.None;
// Hide the legend.
chart.Legend.Visible = false;
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the MajorTickMarks property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.