This documentation is archived and is not being maintained.

LegendItemsCollection::Add Method (Color, String)

Adds a custom LegendItem object with the specified text and symbol color to the end of the collection.

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

public:
int Add(
	Color color, 
	String^ text
)

Parameters

color
Type: System.Drawing::Color
The symbol color of the legend item.
text
Type: System::String
The legend item text.

Return Value

Type: System::Int32
An integer that represents the location in the zero-based index where the item was inserted into the collection.

Appends a custom legend item with the specified text and symbol color to the end of the collection.

To add a custom legend item that uses an image for its symbol, call the Add method.

To insert a custom LegendItem object into the collection, use one of the Insert methods in this class.

.NET Framework

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: