DataPointCollection.DataBindXY 方法

定义

将集合数据点的 X 值和 Y 值绑定到指定数据源第一列的数据。Data binds the X-value and Y-values of the collection's data points to the first columns of the specified data source.

重载

DataBindXY(IEnumerable, IEnumerable[])

将集合数据点的 X 值和 Y 值绑定到指定数据源第一列的数据。Data binds the X-value and Y-values of the collection's data points to the first columns of the specified data source.

DataBindXY(IEnumerable, String, IEnumerable, String)

将集合中数据点的 X 值和 Y 值绑定到指定数据源的指定列的数据。Data binds the X-value and Y-values of the data points in the collection to the specified columns of the specified data sources.

DataBindXY(IEnumerable, IEnumerable[])

将集合数据点的 X 值和 Y 值绑定到指定数据源第一列的数据。Data binds the X-value and Y-values of the collection's data points to the first columns of the specified data source.

public:
 void DataBindXY(System::Collections::IEnumerable ^ xValue, ... cli::array <System::Collections::IEnumerable ^> ^ yValues);
public void DataBindXY (System.Collections.IEnumerable xValue, params System.Collections.IEnumerable[] yValues);
member this.DataBindXY : System.Collections.IEnumerable * System.Collections.IEnumerable[] -> unit
Public Sub DataBindXY (xValue As IEnumerable, ParamArray yValues As IEnumerable())

参数

xValue
IEnumerable

将为数据点提供 X 值的数据源。The data source that will supply the X-values for the data points.

yValues
IEnumerable[]

添加到集合的 DataPoint 对象的 Y 值的逗号分隔列表。A comma-separated list of the Y-value(s) of the DataPoint object added to the collection.

注解

此方法绑定中DataPointSeries所有对象,并为 X 和 Y 值使用单独的数据源。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. 若要绑定到第一列之外的列,请使用DataBindXY方法。To bind to a column other than the first column, use the DataBindXY method.

可以通过为IEnumerable<T> yValues参数提供以逗号分隔的对象列表,来绑定到多个 Y 值。You can bind to multiple Y-values by providing a comma-separated list of IEnumerable<T> objects for the yValues parameter.

如果数据源未提供 Y 值,或者如果提供的值的数目不正确,则将引发异常。If Y-values are not provided by the data source, or if the wrong number of values are provided, an exception will be thrown.

如果不想显示同时使用 X 和 Y 值的散点图类型图形,请改用其中一DataBindY种方法。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:

  • DataViewDataView

  • 数据读取器(SQL、OleDB)Data readers (SQL, OleDB)

  • 数组Arrays

  • 列表Lists

  • 使用IEnumerable<T>接口的所有其他对象。All other objects that use the IEnumerable<T> interface.

DataBindXY(IEnumerable, String, IEnumerable, String)

将集合中数据点的 X 值和 Y 值绑定到指定数据源的指定列的数据。Data binds the X-value and Y-values of the data points in the collection to the specified columns of the specified data sources.

public:
 void DataBindXY(System::Collections::IEnumerable ^ xValue, System::String ^ xField, System::Collections::IEnumerable ^ yValue, System::String ^ yFields);
public void DataBindXY (System.Collections.IEnumerable xValue, string xField, System.Collections.IEnumerable yValue, string yFields);
member this.DataBindXY : System.Collections.IEnumerable * string * System.Collections.IEnumerable * string -> unit
Public Sub DataBindXY (xValue As IEnumerable, xField As String, yValue As IEnumerable, yFields As String)

参数

xValue
IEnumerable

将为数据点提供 X 值的数据源。The data source that will supply the X-values for the data points.

xField
String

将为数据点提供 X 值的列的名称。The name of the column that will supply the X-values for the data points.

yValue
IEnumerable

添加到集合的 DataPoint 对象的 Y 值的逗号分隔列表。A comma-separated list of the Y-value(s) of the DataPoint object added to the collection.

yFields
String

一个逗号分隔列表,其中列出了将应用数据点的 Y 值的列名称。A comma-separated list of column name(s) that will supply the Y-values for the data points. 请注意,若要在列名称中嵌入逗号,可以使用双逗号。Note that a comma can be embedded as part of a column name, by using a double comma.

注解

数据将集合中数据点的 X 值和 Y 值绑定到指定数据源的第一列。Data binds the X-value and Y-values of the data points in the collection to the specified data source's first columns.

可以通过将yFields参数设置为多个列名来绑定到多个 Y 值。You can bind to several Y-values by setting the yFields parameter to multiple column names. 用逗号分隔列名称。Separate the column names with commas.

如果数据源未提供 Y 值,或者如果提供的值的数目不正确,则将引发异常。If Y-values are not provided by the data source, or if the wrong number of values are provided, an exception will be thrown.

如果不想显示同时使用 X 和 Y 值的散点图类型图形,请改用其中一DataBindY种方法。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:

  • DataViewDataView

  • 数据读取器(SQL、OleDB)Data readers (SQL, OleDB)

  • 数组Arrays

  • 列表Lists

  • 使用IEnumerable<T>接口的所有其他对象。All other objects that use the IEnumerable<T> interface.

适用于