SeriesTemplate.SeriesDataMember Property
Gets or sets the name of the data member whose values identify series.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v26.1.dll
NuGet Package: DevExpress.Charts
Declaration
[XtraChartsLocalizableCategory(XtraChartsCategory.Data)]
public string SeriesDataMember { get; set; }
Property Value
| Type | Description |
|---|---|
| String | The name of the data member whose values identify series. |
Example
The following code demonstrates how to automatically generate series and fill them with data from a data source. It uses the classes and properties below:
| Symbol | Description |
|---|---|
| ChartControl.SeriesTemplate | Returns the series template the chart uses to generate its series. |
| SeriesTemplate | The series template that the chart uses to generate its series. |
SeriesTemplate.SeriesDataMember |
Gets or sets the name of the data member whose values identify series. |
| SeriesBase.ArgumentDataMember | Gets or sets the name of the data field that contains series point arguments. |
| SeriesBase.ValueDataMembers | Gets a collection of the names of data fields that contain series point values. |
class GdpInfo {
public int Year { get; set; }
public String Region { get; set; }
public double Value { get; set; }
}
// ...
// Note that the GetGdpDataSource method is not a part of the Chart Control API.
// This method provides a data object list that the Chart should display.
List<GdpInfo> gdpDataSource = GetGdpDataSource();
chartControl.DataSource = gdpDataSource;
chartControl.SeriesTemplate.SeriesDataMember = "Year";
chartControl.SeriesTemplate.ArgumentDataMember = "Region";
chartControl.SeriesTemplate.ValueDataMembers.AddRange("Value");
// ...
See Also