DataPointCollection.AddY 方法

定义

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

重载

AddY(Double)

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

AddY(Object[])

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

AddY(Double)

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

public:
 int AddY(double yValue);
public int AddY (double yValue);
member this.AddY : double -> int
Public Function AddY (yValue As Double) As Integer

参数

yValue
Double

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

返回

Int32

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

注解

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

如果数据点需要多个 Y 值,请使用可用于 Y 值数组的方法定义。Use the method definition that allows for an array of Y-values if your data points require more than one Y-value.

如果数据点需要一个 X 值(即,如果要创建散点图),请改用其中一种 AddXY 方法。If your data points need an X-value - that is, if you are creating scatter plots - use one of the AddXY methods instead.

适用于

AddY(Object[])

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

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

参数

yValue
Object[]

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

返回

Int32

一个 integer 值,该值表示集合中项插入处的零始索引。An integer that represents the location in 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. 此方法还检查 ChartType DataPoint 此数据所属对象的属性; 如果指定的 Y 值太多,将引发异常。This method also checks the ChartType property of the DataPoint object this data belongs to; if too many Y-values are specified, an exception will be thrown.

X 值将始终设置为零 (0) ,导致产生非散点图。The X-value will always be set to zero (0), resulting in non-scatter plots. 如果希望数据点使用 X 值,请改为调用 AddXY 方法之一。If you want the data points to use an X-value, call one of the AddXY methods instead.

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

有关可用于对象类型参数的有效 .NET Framework 类型的完整列表,请参阅以下内容:Refer to the following for a complete listing of valid .NET Framework types that can be used for the object type parameters:

字符串String DateTimeDateTime DoubleDouble
小数Decimal SingleSingle Int32Int32
UInt32UInt32 Int64Int64 UInt64UInt64

适用于