Skip to main content
A newer version of this page is available. .

TickmarksBase.Visible Property

Gets or sets a value indicating whether tickmarks are displayed on an axis.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v19.1.dll

Declaration

[XtraSerializableProperty]
public bool Visible { get; set; }

Property Value

Type Description
Boolean

true if tickmarks are visible; otherwise, false.

Remarks

Use the Visible property, to show or hide major tickmarks on an axis.

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

// 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;

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Visible 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.

See Also