Skip to main content

ChartControl.DataSource Property

Gets or sets the chart control’s data source.

Namespace: DevExpress.Xpf.Charts

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

NuGet Package: DevExpress.Wpf.Charts

Declaration

public object DataSource { get; set; }

Property Value

Type Description
Object

A Object that represents the chart’s data source.

Remarks

Use the DataSource property for data binding using a series template.

When a data source is assigned to the DataSource property, define the name of a data column upon which new series will be created (and named), via the Diagram.SeriesDataMember property. And, for the Diagram.SeriesTemplate property, choose the common view type for the auto-created series. Then, assign the required data fields to the Series.ArgumentDataMember and Series.ValueDataMember properties.

Note that if the Chart’s data source implements the INotifyCollectionChanged interface, the Chart Control automatically handles data source changes and updates its representation. Call the ChartControl.UpdateData method to update the Chart’s data manually in other cases.

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

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.

See Also