Skip to main content

ChartLineOptions.Visible Property

Gets or sets a value indicating whether the specific lines are visible on a chart.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v23.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

bool Visible { get; set; }

Property Value

Type Description
Boolean

true, to display the lines; otherwise, false.

Property Paths

You can access this nested property as listed below:

Object Type Path to Visible
Axis
.MajorGridlines .Visible
Axis
.MinorGridlines .Visible
ChartView
.DropLines .Visible
ChartView
.HighLowLines .Visible
ChartView
.SeriesLines .Visible
DataLabelOptions
.LeaderLines .Visible

Remarks

Use the Visible property to display or hide the major (Axis.MajorGridlines) and minor (Axis.MinorGridlines) gridlines, leader lines (DataLabelOptions.LeaderLines), drop lines (ChartView.DropLines), high-low lines (ChartView.HighLowLines), or series lines (ChartView.SeriesLines) on a chart.

Example

The example below demonstrates how to create a simple line chart and display major gridlines for the category axis and the minor gridlines for the value axis by setting the ChartLineOptions.Visible property to true.

View Example

Worksheet worksheet = workbook.Worksheets["chartTask5"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Create a chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.Line, worksheet["B2:C8"]);
chart.TopLeftCell = worksheet.Cells["F2"];
chart.BottomRightCell = worksheet.Cells["L15"];

// Display the major gridlines of the category axis.
chart.PrimaryAxes[0].MajorGridlines.Visible = true;
// Display the minor gridlines of the value axis.
chart.PrimaryAxes[1].MinorGridlines.Visible = true;

// Hide the legend.
chart.Legend.Visible = false;

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