Version

DataSource Property (DataAppearance)

Gets/sets the object which the Chart uses for data.
Syntax
'Declaration
 
Public Property DataSource As Object
public object DataSource {get; set;}

Property Value

A variety of object types may be specified as the DataSource, see below for details.
Remarks

The control supports a variety of data source types.

The most robust and extensible data source is the DataTable, which provides update notifications via the IBindingList interface. Use of these built-in ADO.NET data management types offers the greatest flexibility.

Many charts also support data-binding to ICollections (including simple arrays) provided the a single-typed, one-dimensional array can meet the chart type's Data Requirements. Chartable data sources include custom ICollections, and custom data objects that additionally support IBindingList may take advantage of live data-binding to the chart component.

Another data source that may be provided is the local filename of an XML or comma-delimited text file.

XML documents require an internal XML Schema document, and must be readily mappable to the Framework's DataSet (their msdata:IsDataSet attribute is set to true). The schema is also necessary since each XML element must be strongly-typed (otherwise their data type will be inferred as xsd:string and this will not translate readily into a DataSet, even though the data content of the element may be numeric.) Please see Generating DataSet Relational Structure from XML Schema in the .NET Framework documentation for more on the issues involved, and consult the samples included with this product for working schema.

Data may be unbound from a chart by calling the ResetDataSource method.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also