Back to Devexpress

TickmarksBase.MinorLength Property

corelibraries-devexpress-dot-xtracharts-dot-tickmarksbase-6bc63edd.md

latest4.7 KB
Original Source

TickmarksBase.MinorLength Property

Gets or sets the length of the minor tickmarks.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public int MinorLength { get; set; }
vb
Public Property MinorLength As Integer

Property Value

TypeDescription
Int32

An integer value which specifies the length of the minor tickmarks, in pixels. It should be greater than 0.

|

Remarks

To specify the length of the major tickmarks, use the corresponding TickmarksBase.Length property.

For more information, refer to Grid Lines, Tickmarks and Interlacing.

Example

This example demonstrates how the grid lines and tickmarks of an axis can be customized at runtime.

To access an axis, you should cast your chart’s diagram object to the required diagram type. Then, use the Axis2D.Tickmarks and AxisBase.GridLines properties to access the corresponding elements. To define the number of minor tickmarks (grid lines), use the AxisBase.MinorCount property.

csharp
// Cast the chart's diagram to the XYDiagram type, to access its axes.
XYDiagram diagram = (XYDiagram)chartControl1.Diagram;

// Customize the appearance of the axes' tickmarks.
diagram.AxisX.Tickmarks.CrossAxis = true;
diagram.AxisX.Tickmarks.Length = 5;
diagram.AxisX.Tickmarks.Thickness = 2;

diagram.AxisY.Tickmarks.Visible = false;
diagram.AxisY.Tickmarks.MinorVisible = false;

diagram.AxisX.Tickmarks.MinorLength = 3;
diagram.AxisX.Tickmarks.MinorThickness = 1;

diagram.AxisX.MinorCount = 2;
diagram.AxisY.MinorCount = 4;

// Customize the appearance of the axes' grid lines.
diagram.AxisX.GridLines.Visible = false;
diagram.AxisX.GridLines.MinorVisible = false;

diagram.AxisY.GridLines.Visible = true;
diagram.AxisY.GridLines.MinorVisible = true;

diagram.AxisY.GridLines.Color = Color.Red;
diagram.AxisY.GridLines.LineStyle.DashStyle = DashStyle.Solid;
diagram.AxisY.GridLines.LineStyle.Thickness = 2;

diagram.AxisY.GridLines.MinorColor = Color.Blue;
diagram.AxisY.GridLines.MinorLineStyle.DashStyle = DashStyle.Dash;
diagram.AxisY.GridLines.MinorLineStyle.Thickness = 1;
vb
' Cast the chart's diagram to the XYDiagram type, to access its axes.
Dim diagram As XYDiagram = CType(chartControl1.Diagram, XYDiagram)

' Customize the appearance of the axes' tickmarks.
diagram.AxisX.Tickmarks.CrossAxis = True
diagram.AxisX.Tickmarks.Length = 5
diagram.AxisX.Tickmarks.Thickness = 2

diagram.AxisY.Tickmarks.Visible = False
diagram.AxisY.Tickmarks.MinorVisible = False

diagram.AxisX.Tickmarks.MinorLength = 3
diagram.AxisX.Tickmarks.MinorThickness = 1

diagram.AxisX.MinorCount = 2
diagram.AxisY.MinorCount = 4

' Customize the appearance of the axes' grid lines.
diagram.AxisX.GridLines.Visible = False
diagram.AxisX.GridLines.MinorVisible = False

diagram.AxisY.GridLines.Visible = True
diagram.AxisY.GridLines.MinorVisible = True

diagram.AxisY.GridLines.Color = Color.Red
diagram.AxisY.GridLines.LineStyle.DashStyle = DashStyle.Solid
diagram.AxisY.GridLines.LineStyle.Thickness = 2

diagram.AxisY.GridLines.MinorColor = Color.Blue
diagram.AxisY.GridLines.MinorLineStyle.DashStyle = DashStyle.Dash
diagram.AxisY.GridLines.MinorLineStyle.Thickness = 1

See Also

Length

MinorThickness

Grid Lines, Tickmarks and Interlacing

TickmarksBase Class

TickmarksBase Members

DevExpress.XtraCharts Namespace