Xceed Chart for WinForms v4.4 Documentation
Importing from Enumerable

Welcome to Xceed Chart for WinForms v4.4 > User Guide > Data Manipulation > Importing > Importing from Enumerable

The data contained in the data series can be imported from any object that implements the IEnumerable interface. The type of the objects contained in the enumerable class must be compatible with the data series type. For more information regarding data series compatibility, see the General Concepts an Terminology topic. 

Importing from an enumerable data source is implemented by the FillFromEnumerable method of the DataSeries class. As its only parameter, the method receives a reference to an object implementing the IEnumerable interface. 

The following example imports a double array into the Values data series of a bar series:

VB.NET  

' Create an array of doubles

Dim arrValues() As Double = {2, 14, 5, 9, 12, 7, 45, 13}

 

' import into the Values data series

bar.Values.FillFromEnumerable(arrValues)

C#  
// Create an array of doubles
double [] arrValues = { 2, 14, 5, 9, 12, 7, 45, 13 };
// import into the Values data series
bar.Values.FillFromEnumerable(arrValues);

See Also

DataSeries