Skip to main content

SeriesTemplateAdapter Class

Stores settings that specify how the chart generates series from a data source based on a series template.

Namespace: DevExpress.Maui.Charts

Assembly: DevExpress.Maui.Charts.dll

NuGet Package: DevExpress.Maui.Charts


public class SeriesTemplateAdapter :

The following members return SeriesTemplateAdapter objects:


ChartView can generate series from the bound data source based on a template that defines series type and settings. This functionality is available if the data source stores data for all series (their names, point arguments and values), and can be useful when the number of series is unknown or very large.

Use the SeriesTemplateAdapter class properties to adjust settings for series generation.


In this example, the chart generates bar series that visualize GDP per capita by year for the G7 from 2017 to 2019.


  1. Create a data source for series generation. Each object in the list stores a country’s name, year, and the GDP value for this year.

    using System.Collections.Generic;
    namespace SeriesTemplateExample {
        public class ViewModel {
            CountryYearlyStatisticsData data = new CountryYearlyStatisticsData();
            public List<CountryGdpStatistics> SeriesData =>;
        public class CountryYearlyStatisticsData {
            public List<CountryGdpStatistics> SeriesData { get; } = new List<CountryGdpStatistics> {
                new CountryGdpStatistics("UK", 45903.9, 2017),
                new CountryGdpStatistics("UK", 48651.6, 2018),
                new CountryGdpStatistics("UK", 49912.4, 2019),
                new CountryGdpStatistics("USA", 60091.6, 2017),
                new CountryGdpStatistics("USA", 63043.0, 2018),
                new CountryGdpStatistics("USA", 65240.4, 2019),
                new CountryGdpStatistics("Canada", 48479.8, 2017),
                new CountryGdpStatistics("Canada", 51106.9, 2018),
                new CountryGdpStatistics("Canada", 51822.2, 2019),
                new CountryGdpStatistics("Japan", 41119.4, 2017),
                new CountryGdpStatistics("Japan", 42840.2, 2018),
                new CountryGdpStatistics("Japan", 43642.7, 2019),
                new CountryGdpStatistics("France", 44622.8, 2017),
                new CountryGdpStatistics("France", 47922.2, 2018),
                new CountryGdpStatistics("France", 50693.5, 2019),
                new CountryGdpStatistics("Germany", 53122.0, 2017),
                new CountryGdpStatistics("Germany", 56689.0, 2018),
                new CountryGdpStatistics("Germany", 57557.9, 2019),
                new CountryGdpStatistics("Italy", 41713.9, 2017),
                new CountryGdpStatistics("Italy", 44444.7, 2018),
                new CountryGdpStatistics("Italy", 45691.0, 2019),
        public class CountryGdpStatistics {
            public string Country { get; private set; }
            public double Gdp { get; private set; }
            public int Year { get; private set; }
            public CountryGdpStatistics(string country, double gdp, int year) {
                Country = country;
                Gdp = gdp;
                Year = year;
  2. Set the ChartView.SeriesDataTemplate property to a SeriesTemplateAdapter object with the following properties specified (all these settings are required for series generation):

    • DataSource – the data source for chart series.
    • SeriesDataMember – a data source field whose unique values identify series.
    • ArgumentDataMember – a data source field that contains arguments for series points. Each point requires one argument value.
    • ValueDataMembers – a collection of data source fields that contain values for series points. The number of fields you need to specify in this collection depends on the series type – some series (for example, Bubble or Stock) require more than one value for each argument.
    • SeriesTemplate – a template that defines the type of generated series and configures series settings and elements. This template’s binding context is a SeriesTemplateData object. Its SeriesDataMemberValue property returns values of the data source field assigned to SeriesDataMember. Bind this property to the series DisplayName.
    <ContentPage xmlns:x=""
                <dxc:SeriesTemplateAdapter DataSource="{Binding SeriesData}"
                        <dxc:ValueDataMember Type="Value" Member="Gdp"/>
                            <dxc:BarSeries DisplayName="{Binding Path=SeriesDataMemberValue}"/>
                <dxc:NumericAxisY AlwaysShowZeroLevel="False">
                        <dxc:AxisStyle MajorTickmarksVisible="True"
                        <dxc:AxisTitle Text="Total GDP per capita, USD"/>
                <dxc:NumericAxisX GridAlignment="1"/>

ChartView displays generated series in addition to series that you define in the Series collection.


See Also