Series 构造函数
定义
重载
| Series() |
初始化 Series 类的新实例。Initializes a new instance of the Series class. |
| Series(String) |
使用指定的系列名称初始化 Series 类的新实例。Initializes a new instance of the Series class with the specified series name. |
| Series(String, Int32) |
初始化指定名称和 Y 值的最大数目 Series 类的新实例。Initializes a new instance of the Series class with the specified name and maximum number of Y-values. |
Series()
Series(String)
public:
Series(System::String ^ name);
public Series (string name);
new System.Windows.Forms.DataVisualization.Charting.Series : string -> System.Windows.Forms.DataVisualization.Charting.Series
Public Sub New (name As String)
参数
- name
- String
将创建的 Series 对象的名称。The name of the Series object that will be created. 该名称必须为唯一名称;否则,将引发异常。This must be a unique name; otherwise, an exception will be thrown.
注解
此构造函数可用于创建类的新实例 Series 。This constructor can be used to create a new instance of the Series class.
备注
此序列仅能存储 DataPoint 具有一个 Y 值的对象。This series is only capable of storing DataPoint objects that have one Y-value. 如果将具有多个 Y 值的数据点添加到此序列,则会引发异常。If a data point that has multiple Y-values is added to this series, an exception will be thrown.
若要在运行时创建一个序列,请使用 Add 方法。To create a series at run time, use the Add method.
适用于
Series(String, Int32)
public:
Series(System::String ^ name, int yValues);
public Series (string name, int yValues);
new System.Windows.Forms.DataVisualization.Charting.Series : string * int -> System.Windows.Forms.DataVisualization.Charting.Series
Public Sub New (name As String, yValues As Integer)
参数
- yValues
- Int32
属于此系列的 DataPoint 对象最多可拥有的 Y 值数。The maximum number of Y-values allowed for the DataPoint objects that belong to this series.
注解
使用此构造函数创建并初始化类的新实例 Series 。Use this constructor to create and initialize a new instance of the Series class.
重要
此序列将只能存储 DataPoint 比参数设置的最大值更多的对象 yValues 。This series will only be able to store DataPoint objects that do not have more Y-values than the maximum set by the yValues parameter. 如果添加的数据点的 Y 值超过设置的最大值,则会引发异常。If you add a data point that has more Y-values than the set maximum, an exception will be thrown.
若要 Series 在运行时创建对象, Add Insert 还可以使用序列集合属性的和方法。To create a Series object at runtime, the Add and Insert methods of the Series collection property can also be used.