.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Axis.MajorUnit Property

Gets or sets the distance between the major tick marks and major gridlines on the chart.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v21.1.Core.dll


double MajorUnit { get; set; }

Property Value

Type Description

A Double value that specifies the major unit for the value or date axis.


The MajorUnit property determines how many intervals the value or date axis is divided into. To automatically evaluate the major unit value, utilize the Axis.SetAutoMajorUnit method.

Use the Axis.BaseTimeUnit property to specify the base time unit for the date axis. The base unit indicates how to plot data along the axis (in days, months, or years). You can also set the time unit for major and minor tick marks on the date axis by utilizing the Axis.MajorTimeUnit and Axis.MinorTimeUnit properties, respectively.


The example below demonstrates how to create the 100% Stacked Bar chart and specify the interval of major tick marks and major gridlines for the value axis by using the Axis.MajorUnit property.

Dim worksheet As Worksheet = workbook.Worksheets("chartTask2")
workbook.Worksheets.ActiveWorksheet = worksheet

' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.BarFullStacked)
chart.TopLeftCell = worksheet.Cells("E3")
chart.BottomRightCell = worksheet.Cells("K14")
' Select chart data.
chart.SelectData(worksheet("B4:C8"), ChartDataDirection.Row)

' Set the major unit of the value axis.
chart.PrimaryAxes(1).MajorUnit = 0.2

' Hide the legend.
chart.Legend.Visible = False
See Also