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

Series Class

Represents the base class for all 2D Series and 3D Series types.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v18.2.dll

Declaration

public abstract class Series :
    ChartElement,
    ISeries,
    ISeriesBase,
    ISeriesPointFactory,
    ISeriesFactory,
    ISeriesView,
    ISeriesDataAdapter,
    ILegendVisible,
    IWeakEventListener,
    IAnimatableElement,
    IWizardDataProvider,
    IInteractiveElement,
    IPatternHolder,
    ISeriesLabelDataProvider,
    IBindingPropertiesSource,
    ISeriesBindingProvider,
    IBindingProvider,
    IFilteredComponent,
    IFilteredComponentBase,
    IPointsFilterOptions

Remarks

The Series class implements general functionality common for all series classes derived from it. Instances of the Series class descendants are available in the SeriesCollection, which is returned by the Diagram.Series property. Note that although series of different types can be represented together in this collection, not all series types are compatible with all diagram types. To learn more on compatibility, refer to the Series Types Compatibility document.

Every series contains series data points, which are either present in its Series.Points collection, or provided from a datasource assigned to the Series.DataSource property along with the Series.ArgumentDataMember and Series.ValueDataMember settings. The types of series arguments and values are defined by the Series.ArgumentScaleType and Series.ValueScaleType property values.

Series labels are maintained by the Series.Label property, while the format of the text inside them is defined by the Series.PointOptions property settings. In addition, you can specify Series.LegendPointOptions to determine how series points are identified in a chart’s legend, or completely hide a series from a legend by setting the Series.ShowInLegend property to false.

Example

The following example demonstrates how to create a 2D Side-by-Side Bar. To do this, it is necessary to assign the ChartControl.Diagram property to XYDiagram2D, and then add two series with points to the diagram’s Diagram.Series collection.

<Window x:Class="SideBySideBar2DChart.Window1" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts" 
        Title="Window1" Height="350" Width="620">
    <Grid>
        <dxc:ChartControl Name="chartControl1">
            <dxc:ChartControl.Diagram>
                <dxc:XYDiagram2D>
                    <dxc:XYDiagram2D.Series>
                        <dxc:BarSideBySideSeries2D DisplayName="First Series" BarWidth="0.5">
                            <!--region #Model-->
                            <dxc:BarSideBySideSeries2D.Model>
                                <dxc:Quasi3DBar2DModel />
                            </dxc:BarSideBySideSeries2D.Model>
                            <!--endregion #Model-->
                            <dxc:BarSideBySideSeries2D.Points>
                                <dxc:SeriesPoint Argument="A" Value="1" />
                                <dxc:SeriesPoint Argument="B" Value="2" />
                                <dxc:SeriesPoint Argument="C" Value="3" />
                                <dxc:SeriesPoint Argument="D" Value="4" />
                            </dxc:BarSideBySideSeries2D.Points>
                        </dxc:BarSideBySideSeries2D>
                        <dxc:BarSideBySideSeries2D DisplayName="Second Series" BarWidth="0.5">
                            <!--region #Model2-->
                            <dxc:BarSideBySideSeries2D.Model>
                                <dxc:Quasi3DBar2DModel />
                            </dxc:BarSideBySideSeries2D.Model>
                            <!--endregion #Model2-->
                            <dxc:BarSideBySideSeries2D.Points>
                                <dxc:SeriesPoint Argument="A" Value="4" />
                                <dxc:SeriesPoint Argument="B" Value="3" />
                                <dxc:SeriesPoint Argument="C" Value="2" />
                                <dxc:SeriesPoint Argument="D" Value="1" />
                            </dxc:BarSideBySideSeries2D.Points>
                        </dxc:BarSideBySideSeries2D>
                    </dxc:XYDiagram2D.Series>
                </dxc:XYDiagram2D>
            </dxc:ChartControl.Diagram>
            <dxc:ChartControl.Legend>
                <dxc:Legend />
            </dxc:ChartControl.Legend>
        </dxc:ChartControl>
    </Grid>
</Window>

The following code snippets (auto-collected from DevExpress Examples) contain references to the Series class.

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.

Implements

See Also