How to: Change the View of a Series

This topic illustrates how to change the current view type of a series at both design and runtime.

  • Design time.

    To change the view type of a particular series, select this series at design time, and in the Property Grid, click the ellipsis button for the SeriesBase.View property.

    SeriesBase_ChangeView1.png

    In the invoked Choose Series View dialog, choose the new view type and click OK.

    SeriesBase_ChangeView2.png

  • Runtime.

    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);
    }
    
See Also