ComponentOne FlexChart for UWP
FlexChart / Working with FlexChart / FlexChart Elements / FlexChart Series / Creating and Adding Series
In This Topic
    Creating and Adding Series
    In This Topic

    By default, FlexChart for UWP displays three series containing dummy data at design-time as well as run-time. However, you can provide your own data and display the series with that data. For information on how to provide data to FlexChart, refer to Providing Data.

    You first need to create a series by using the Series object. And then, you need to add the series to the FlexChart Series collection using the Add method in the C1FlexChart.Series collection property.

    The following code shows how to create and add a series in FlexChart at run-time.

    <Chart:Series Binding="Y" BindingX="X" SeriesName="Series 4">
        <Chart:Series.ItemsSource>
            <PointCollection>
                <Foundation:Point>1,8</Foundation:Point>
                <Foundation:Point>2,12</Foundation:Point>
                <Foundation:Point>3,10</Foundation:Point>
                <Foundation:Point>4,12</Foundation:Point>
                <Foundation:Point>5,15</Foundation:Point>
            </PointCollection>
        </Chart:Series.ItemsSource>
    </Chart:Series>
    
    C#
    Copy Code
    C1.Xaml.Chart.Series series4 = new C1.Xaml.Chart.Series();
    flexChart.Series.Add(series4);