Back to Devexpress

TickmarksBase.MinorVisible Property

corelibraries-devexpress-dot-xtracharts-dot-tickmarksbase-865382fd.md

latest8.0 KB
Original Source

TickmarksBase.MinorVisible Property

Gets or sets a value indicating whether the minor tickmarks are displayed by an axis.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public bool MinorVisible { get; set; }
vb
Public Property MinorVisible As Boolean

Property Value

TypeDescription
Boolean

true if the minor tickmarks are visible; otherwise, false.

|

Remarks

Use the MinorVisible property to show or hide minor tickmarks on an axis.

When enabled, minor tickmarks can be further customized via the TickmarksBase.MinorLength and TickmarksBase.MinorThickness properties.

To show or hide the major tickmarks, use the TickmarksBase.Visible 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

The following code snippets (auto-collected from DevExpress Examples) contain references to the MinorVisible 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.

winforms-charts-create-stacked-bar-chart/CS/Series_StackedBarChart/Form1.cs#L35

csharp
XYDiagram diagram = (XYDiagram)chart.Diagram;
diagram.AxisX.Tickmarks.MinorVisible = false;

winforms-charts-create-a-side-by-side-stacked-bars/CS/SideBySideStackedBarChart/Form1.cs#L39

csharp
XYDiagram diagram = chart.Diagram as XYDiagram;
diagram.AxisX.Tickmarks.MinorVisible = false;
diagram.AxisY.WholeRange.AlwaysShowZeroLevel = false;

winforms-charts-use-automatic-date-time-scale-modes-of-an-axis/CS/DateTimeAggregation/Form1.cs#L108

csharp
AxisX.DateTimeScaleOptions.GridSpacing = 1;
AxisX.Tickmarks.MinorVisible = false;
AxisX.Label.Angle = 0;

winforms-charts-create-stacked-bar-chart/VB/Series_StackedBarChart/Form1.vb#L34

vb
Dim diagram As XYDiagram = CType(chart.Diagram, XYDiagram)
diagram.AxisX.Tickmarks.MinorVisible = False
' Add a chart title:

winforms-charts-create-a-side-by-side-stacked-bars/VB/SideBySideStackedBarChart/Form1.vb#L39

vb
Dim diagram As XYDiagram = TryCast(chart.Diagram, XYDiagram)
diagram.AxisX.Tickmarks.MinorVisible = False
diagram.AxisY.WholeRange.AlwaysShowZeroLevel = False

winforms-charts-use-automatic-date-time-scale-modes-of-an-axis/VB/DateTimeAggregation/Form1.vb#L95

vb
AxisX.DateTimeScaleOptions.GridSpacing = 1
AxisX.Tickmarks.MinorVisible = False
AxisX.Label.Angle = 0

See Also

Visible

Grid Lines, Tickmarks and Interlacing

TickmarksBase Class

TickmarksBase Members

DevExpress.XtraCharts Namespace