Series.ChartArea 属性

定义

获取或设置用于绘制数据系列的 ChartArea 对象(如果有)的名称。

public:
 property System::String ^ ChartArea { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.DataVisualization.Charting.SeriesAreaNameConverter))]
public string ChartArea { get; set; }
[<System.ComponentModel.Bindable(true)>]
[<System.ComponentModel.TypeConverter(typeof(System.Web.UI.DataVisualization.Charting.SeriesAreaNameConverter))>]
member this.ChartArea : string with get, set
Public Property ChartArea As String

属性值

String

一个 string 值,表示用于绘制系列的 ChartArea 对象。

属性

示例

' Create a new legend and associate three series with the legend.  
Public Sub CreateSecondLegend()  
    ' Attach the first series to a chart area.  
    Chart1.Series["Series1"].ChartArea = "Chart Area 1";  

    ' Attach the second series to a chart area.  
    Chart1.Series["Series2"].ChartArea = "Chart Area 2";  

End Sub 'CreateSecondLegend  
// Create a new legend and associate three series with the legend.  
public void CreateSecondLegend()  
{  
     // Attach the first series to a chart area.  
     Chart1.Series["Series1"].ChartArea = "Chart Area 1";  

     // Attach the second series to a chart area.  
     Chart1.Series["Series2"].ChartArea = "Chart Area 2";  

}  

注解

在设计时和运行时添加序列时,会自动将其分配给"Default"对象;如果"Default"不存在,则会自动将其分配给 中的第一个 ChartArea ChartAreaCollection 可用图表区域。

如果不希望绘制序列,则将此属性设置为长度为零的字符串。

适用于