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

SeriesBase.ChangeView(ViewType) Method

Changes the series’ view type by specifying its type.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v20.2.dll

NuGet Packages: DevExpress.Charts, DevExpress.WindowsDesktop.Charts

Declaration

public void ChangeView(
    ViewType viewType
)

Parameters

Name Type Description
viewType ViewType

A ViewType enumeration value.

Remarks

The ChangeView method can be used to change the view type of a series object by specifying the required type of a series view.

A call to this method affects the value of the series’ SeriesBase.View property.

Example

The following example demonstrates how to programmatically change the current series view via the SeriesBase.ChangeView method. Note that this method is better than directly changing the SeriesBase.View property, because the ChangeView is implemented in a way that saves the property values of the old view to the greatest degree possible.

using DevExpress.XtraCharts;
// ...

public void ToPie(SeriesBase series) {
    series.ChangeView(ViewType.Pie);
}

public void ToBars(SeriesBase series) {
    series.ChangeView(ViewType.Bar);
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the ChangeView(ViewType) method.

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