officefileapi-devexpress-dot-spreadsheet-dot-charts-dot-axis-51793e16.md
Gets or sets the position of major tick marks on the axis.
Namespace : DevExpress.Spreadsheet.Charts
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
AxisTickMarks MajorTickMarks { get; set; }
Property MajorTickMarks As AxisTickMarks
| 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.
|
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.
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;
Dim worksheet As Worksheet = workbook.Worksheets("chartTask3")
workbook.Worksheets.ActiveWorksheet = worksheet
' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet("B3:C5"))
chart.TopLeftCell = worksheet.Cells("H2")
chart.BottomRightCell = worksheet.Cells("N14")
' Set the axis tick marks.
Dim axis As Axis = chart.PrimaryAxes(0)
axis.MajorTickMarks = AxisTickMarks.None
axis = chart.PrimaryAxes(1)
axis.MajorTickMarks = AxisTickMarks.None
' Hide the legend.
chart.Legend.Visible = False
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.
wpf-spreadsheet-chart-api/CS/SpreadsheetWPFChartAPISamples/CodeExamples/StyleActions.cs#L68
axis.Outline.SetNoFill();
axis.MajorTickMarks = AxisTickMarks.None;
winforms-spreadsheet-chart-api/CS/SpreadsheetChartAPISamples/CodeExamples/StyleActions.cs#L87
axis.Outline.SetNoFill();
axis.MajorTickMarks = AxisTickMarks.None;
axis.Outline.SetNoFill();
axis.MajorTickMarks = AxisTickMarks.None;
wpf-spreadsheet-chart-api/VB/SpreadsheetWPFChartAPISamples/CodeExamples/StyleActions.vb#L72
axis.Outline.SetNoFill()
axis.MajorTickMarks = AxisTickMarks.None
winforms-spreadsheet-chart-api/VB/SpreadsheetChartAPISamples/CodeExamples/StyleActions.vb#L71
axis.Outline.SetNoFill()
axis.MajorTickMarks = AxisTickMarks.None
axis.Outline.SetNoFill()
axis.MajorTickMarks = AxisTickMarks.None
See Also