Series.ChartArea Property

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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

Namespace:   System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)

public string ChartArea { get; set; }

Property Value

Type: System.String

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

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.

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


.NET Framework
Available since 4.0
Return to top