DataPointCollection.AddXY 方法

定义

向集合的末尾添加一个具有指定的 X 值和 Y 值的 DataPoint 对象。Adds a DataPoint object to the end of the collection, with the specified X-value and Y-value(s).

重载

AddXY(Double, Double)

向集合的末尾添加一个具有指定的 X 值和 Y 值的 DataPoint 对象。Adds a DataPoint object to the end of the collection, with the specified X-value and Y-value.

AddXY(Object, Object[])

向集合的末尾添加一个具有指定的 X 值和 Y 值的 DataPoint 对象。Adds a DataPoint object to the end of the collection, with the specified X-value and Y-value(s).

AddXY(Double, Double)

向集合的末尾添加一个具有指定的 X 值和 Y 值的 DataPoint 对象。Adds a DataPoint object to the end of the collection, with the specified X-value and Y-value.

public:
 int AddXY(double xValue, double yValue);
public int AddXY (double xValue, double yValue);
member this.AddXY : double * double -> int
Public Function AddXY (xValue As Double, yValue As Double) As Integer

参数

xValue
Double

数据点的 X 值。X-value of the data point.

yValue
Double

数据点的 Y 值。Y-value of the data point.

返回

一个 integer,表示数据点集合中项插入处的零始索引。An integer that represents the zero-based index where the item was inserted into the data point collection.

注解

此方法将DataPoint对象添加DataPointCollection到; 始终将对象添加到集合的末尾。This method adds DataPoint object to the DataPointCollection; the object is always added to the end of the collection.

如果数据点需要多个 Y 值,请使用方法重载。AddXYUse the AddXY method overload if your data points require more than one Y-value.

如果数据点不需要 X 值(即,如果要创建非散点图AddY ),请改用方法。If your data points do not need an X-value - that is, if you are creating non-scatter plots - use the AddY method instead.

AddXY(Object, Object[])

向集合的末尾添加一个具有指定的 X 值和 Y 值的 DataPoint 对象。Adds a DataPoint object to the end of the collection, with the specified X-value and Y-value(s).

public:
 int AddXY(System::Object ^ xValue, ... cli::array <System::Object ^> ^ yValue);
public int AddXY (object xValue, params object[] yValue);
member this.AddXY : obj * obj[] -> int
Public Function AddXY (xValue As Object, ParamArray yValue As Object()) As Integer

参数

xValue
Object

数据点的 X 值。The X value of the data point.

yValue
Object[]

一个或多个逗号分隔值,表示数据点的 Y 值。One or more comma-separated values that represent the Y-value(s) of the data point.

返回

一个 integer 值,该值表示集合中项插入处的零始索引。An integer value that represents the zero-based index where the item was inserted into the collection.

注解

此方法将一个DataPoint对象添加DataPointCollection到; 数据点总是添加到集合的末尾。This method adds one DataPoint object to the DataPointCollection; the data point is always added to the end of the collection.

必须提供至少一(1)个 Y 值,否则将引发异常。You must provide at least one (1) Y-value, otherwise an exception will be thrown. 此方法还检查YValueType此数据所属DataPointCollection对象的属性; 如果指定的 Y 值太多,将引发异常。This method also checks the YValueType property of the DataPointCollection object that this data belongs to; if too many Y-values are specified, an exception will be thrown.

为了使DateTime格式设置生效,值必须为对象。 DateTimeIn order for DateTime formatting to have an effect, a value must be a DateTime object.

如果数据点不需要 X 值(即,如果要创建非散点图AddY ),请改用方法If your data points do not need an X-value - that is, if you are creating non-scatter plots - use the AddY method instead

适用于