Series.ChartArea Property

Definition

Gets or sets the name of the ChartArea object used to plot the data series, if any.

C#
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.DataVisualization.Charting.SeriesAreaNameConverter))]
public string ChartArea { get; set; }

Property Value

A string value that represents a ChartArea object, which is used to plot the series.

Attributes

Examples

C#
// 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";  

}  

Remarks

When a series is added at both design time and run time, it is automatically assigned to the "Default" ChartArea object, or the first available chart area in the ChartAreaCollection if "Default" does not exist.

Set this property to a zero-length string if you do not want the series to be plotted.

Applies to

Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1