.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.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.v19.2.Core.dll

Declaration

double MajorUnit { get; set; }
Property MajorUnit As Double
double MajorUnit { get; set; }
Property MajorUnit As Double
double MajorUnit { get; set; }
Property MajorUnit As Double

Property Value

Type Description
Double

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

Property Value

Type Description
Double

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

Property Value

Type Description
Double

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

Remarks

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.

Examples

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