Back to Devexpress

ChartObject.Views Property

officefileapi-devexpress-dot-spreadsheet-dot-charts-dot-chartobject-f9fb7cac.md

latest6.7 KB
Original Source

ChartObject.Views Property

Returns a collection of chart views.

Namespace : DevExpress.Spreadsheet.Charts

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
ChartViewCollection Views { get; }
vb
ReadOnly Property Views As ChartViewCollection

Property Value

TypeDescription
ChartViewCollection

A collection of ChartView objects. Null ( Nothing in Visual Basic) for Excel 2016 charts.

|

Remarks

Each chart has an associated ChartView. This object is created automatically when you create a chart. Use the Views property to return the ChartViewCollection collection.

Note

Excel 2016 charts do not have associated ChartView objects. Use the Series.LayoutOptions property to specify series options for these charts.

A chart view consolidates series of the same type. A chart may contain several views of compatible types. A chart displays views of compatible types simultaneously.

Compatible types are listed below:

If a series of an incompatible type is added to the chart, chart views are recreated. The resulting chart contains only one view of the most recently added type.

Use the ChartView.Series.Add method to add a series of a particular type. The type of the added series is the same as the type of the view to which it is added (determined by the ChartView.ViewType).

The following code snippets (auto-collected from DevExpress Examples) contain references to the Views 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/Charts.cs#L101

csharp
// Set the gap width between data series
ChartView view = chart.Views[0];
view.GapWidth = 75;

winforms-spreadsheet-chart-api/CS/SpreadsheetChartAPISamples/CodeExamples/Charts.cs#L101

csharp
// Set the gap width between data series
ChartView view = chart.Views[0];
view.GapWidth = 75;

spreadsheet-document-api-chart-examples/CS/SpreadsheetDocServerChartAPISamples/CodeExamples/ChartActions.cs#L115

csharp
// Set the gap width between data series
ChartView view = chart.Views[0];
view.GapWidth = 75;

wpf-spreadsheet-chart-api/VB/SpreadsheetWPFChartAPISamples/CodeExamples/Charts.vb#L105

vb
' Set the gap width between data series
Dim view As ChartView = chart.Views(0)
view.GapWidth = 75

winforms-spreadsheet-chart-api/VB/SpreadsheetChartAPISamples/CodeExamples/Charts.vb#L104

vb
' Set the gap width between data series
Dim view As ChartView = chart.Views(0)
view.GapWidth = 75

spreadsheet-document-api-chart-examples/VB/SpreadsheetDocServerChartAPISamples/CodeExamples/ChartActions.vb#L113

vb
' Set the gap width between data series
Dim view As ChartView = chart.Views(0)
view.GapWidth = 75

See Also

ChartObject Interface

ChartObject Members

DevExpress.Spreadsheet.Charts Namespace