Back to Devexpress

ChartTitleOptions.Visible Property

officefileapi-devexpress-dot-spreadsheet-dot-charts-dot-charttitleoptions.md

latest6.1 KB
Original Source

ChartTitleOptions.Visible Property

Gets or sets a value indicating whether the specific title is displayed on a chart.

Namespace : DevExpress.Spreadsheet.Charts

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
bool Visible { get; set; }
vb
Property Visible As Boolean

Property Value

TypeDescription
Boolean

true , to add the title to the chart; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to Visible
Axis

.Title .Visible

|

Remarks

Use the Visible property to display or hide the chart (ChartObject.Title) or axis (Axis.Title) title.

Example

View Example

csharp
Worksheet worksheet = workbook.Worksheets["chartTask2"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Create a chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.BarClustered, worksheet["B4:C7"]);
chart.TopLeftCell = worksheet.Cells["E3"];
chart.BottomRightCell = worksheet.Cells["K14"];

// Display the chart title and specify the title text.
chart.Title.Visible = true;
chart.Title.SetValue("Market share Q3'13");

// Hide the chart legend.
chart.Legend.Visible = false;
// Specify that each data point in the series has a different color.
chart.Views[0].VaryColors = true;
vb
Dim worksheet As Worksheet = workbook.Worksheets("chartTask2")
workbook.Worksheets.ActiveWorksheet = worksheet

' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.BarClustered, worksheet("B4:C7"))
chart.TopLeftCell = worksheet.Cells("E3")
chart.BottomRightCell = worksheet.Cells("K14")

' Display the chart title and specify the title text.
chart.Title.Visible = True
chart.Title.SetValue("Market share Q3'13")

' Hide the chart legend.
chart.Legend.Visible = False
' Specify that each data point in the series has a different color.
chart.Views(0).VaryColors = True

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/TitlesActions.cs#L22

csharp
// Display default chart title.
chart.Title.Visible = true;
// Display the chart legend.

winforms-spreadsheet-chart-api/CS/SpreadsheetChartAPISamples/CodeExamples/TitlesActions.cs#L22

csharp
// Display default chart title.
chart.Title.Visible = true;
// Display the chart legend.

spreadsheet-document-api-chart-examples/CS/SpreadsheetDocServerChartAPISamples/CodeExamples/TitlesActions.cs#L29

csharp
// Display default chart title.
chart.Title.Visible = true;
// Display the chart legend.

wpf-spreadsheet-chart-api/VB/SpreadsheetWPFChartAPISamples/CodeExamples/TitlesActions.vb#L26

vb
' Display default chart title.
chart.Title.Visible = True
' Display the chart legend.

winforms-spreadsheet-chart-api/VB/SpreadsheetChartAPISamples/CodeExamples/TitlesActions.vb#L25

vb
' Display default chart title.
chart.Title.Visible = True
' Display the chart legend.

spreadsheet-document-api-chart-examples/VB/SpreadsheetDocServerChartAPISamples/CodeExamples/TitlesActions.vb#L27

vb
' Display default chart title.
chart.Title.Visible = True
' Display the chart legend.

See Also

ChartObject.Title

Axis.Title

ChartTitleOptions Interface

ChartTitleOptions Members

DevExpress.Spreadsheet.Charts Namespace