This documentation is archived and is not being maintained.

DataPointCollection::DataBindXY Method (IEnumerable, array<IEnumerable>)

Data binds the X-value and Y-values of the collection's data points to the first columns of the specified data source.

Namespace:  System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)

public:
void DataBindXY(
	IEnumerable^ xValue, 
	... array<IEnumerable^>^ yValues
)

Parameters

xValue
Type: System.Collections::IEnumerable
The data source that will supply the X-values for the data points.
yValues
Type: array<System.Collections::IEnumerable>
A comma-separated list of the Y-value(s) of the DataPoint object added to the collection.

This method binds all DataPoint objects in a Series, and uses separate data sources for the X and Y-value(s).

Note that the first available column in the data source will be used if data-binding to a table. To bind to a column other than the first column, use the DataBindXY method.

You can bind to multiple Y-values by providing a comma-separated list of IEnumerable<T> objects for the yValues parameter.

If Y-values are not provided by the data source, or if the wrong number of values are provided, an exception will be thrown.

If you do not want to display scatter-type plots, in which both X and Y-values are used, use one of the DataBindY methods instead.

The following is a list of objects that you can use as the data source parameter:

  • DataView

  • Data readers (SQL, OleDB)

  • Arrays

  • Lists

  • All other objects that use the IEnumerable<T> interface.

.NET Framework

Supported in: 4

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: