officefileapi-devexpress-dot-spreadsheet-dot-charts-dot-chartlineoptions.md
Gets or sets a value indicating whether the specific lines are visible on a chart.
Namespace : DevExpress.Spreadsheet.Charts
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
bool Visible { get; set; }
Property Visible As Boolean
| Type | Description |
|---|---|
| Boolean |
true , to display the lines; otherwise, false.
|
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
|
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.
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.
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;
Dim worksheet As Worksheet = workbook.Worksheets("chartTask5")
workbook.Worksheets.ActiveWorksheet = worksheet
' Create a chart and specify its location.
Dim chart As 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.
wpf-spreadsheet-chart-api/CS/SpreadsheetWPFChartAPISamples/CodeExamples/TrendlineActions.cs#L54
axis.Scaling.Max = 1.0;
chart.PrimaryAxes[1].MajorGridlines.Visible = false;
winforms-spreadsheet-chart-api/CS/SpreadsheetChartAPISamples/CodeExamples/TrendlineActions.cs#L54
axis.Scaling.Max = 1.0;
chart.PrimaryAxes[1].MajorGridlines.Visible = false;
axis.Scaling.Max = 1.0;
chart.PrimaryAxes[1].MajorGridlines.Visible = false;
wpf-spreadsheet-chart-api/VB/SpreadsheetWPFChartAPISamples/CodeExamples/TrendlineActions.vb#L50
axis.Scaling.Max = 1.0
chart.PrimaryAxes(1).MajorGridlines.Visible = False
winforms-spreadsheet-chart-api/VB/SpreadsheetChartAPISamples/CodeExamples/TrendlineActions.vb#L49
axis.Scaling.Max = 1.0
chart.PrimaryAxes(1).MajorGridlines.Visible = False
axis.Scaling.Max = 1.0
chart.PrimaryAxes(1).MajorGridlines.Visible = False
See Also