Skip to main content

SeriesDataAdapter Class

Provides the data for the ChartView series.

Namespace: DevExpress.XamarinForms.Charts

Assembly: DevExpress.XamarinForms.Charts.dll

NuGet Package: DevExpress.XamarinForms.Charts

Declaration

public class SeriesDataAdapter :
    DataSourceAdapterBase,
    IXYSeriesData,
    IChangeableSeriesData

Example

This example shows how to provide data for the ChartView series.

Set the Data property of your series to a new SeriesDataAdapter instance. Use the DataSource, ArgumentDataMember, and ValueDataMembers properties to specify the data source for the chart, and to define data source members used to generate series points and labels.

public class MainViewModel {
    public List<Gdp> Gdps { get; }
    public IList<GdpValue> GdpValueForChina => Gdps[0].Values;

    public MainViewModel() {
        Gdps = new List<Gdp> {
            new Gdp(
                    "China",
                    new GdpValue(new DateTime(2017, 1, 1), 19.391),
                    // ...
                    new GdpValue(new DateTime(2007, 1, 1), 14.478)
                    ),
            };
    }
}
// ...
public class GdpValue {
    public DateTime Year { get; }
    public double Value { get; }

    public GdpValue(DateTime year, double value) {
        this.Year = year;
        this.Value = value;
    }
}

Inheritance

See Also