LegendItem Constructors

Definition

Initializes a new instance of the LegendItem class.

Overloads

LegendItem()

Initializes a new instance of the LegendItem class.

LegendItem(String, Color, String)

Initializes a new instance of the LegendItem class with the specified name, color and image path.

LegendItem()

Initializes a new instance of the LegendItem class.

C#
public LegendItem();

Remarks

Use this constructor to create and initialize a new instance of the LegendItem class.

Note that you can also add custom legend items using the Add and Insert methods associated with the CustomItems collection property of the Legend object.

Applies to

.NET Framework 4.8.1 and other versions
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

LegendItem(String, Color, String)

Initializes a new instance of the LegendItem class with the specified name, color and image path.

C#
public LegendItem(string name, System.Drawing.Color color, string image);

Parameters

name
String

The name of the legend item.

color
Color

The color of the legend item.

image
String

The path of the image to be displayed for the legend item.

Remarks

Only the image or color parameter needs to be specified. If both are specified, the image parameter has precedence.

Applies to

.NET Framework 4.8.1 and other versions
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