Export (0) Print
Expand All

LegendCell Class

Represents a legend cell in a legend item.

Namespace:  System.Windows.Forms.DataVisualization.Charting
Assembly:  System.Windows.Forms.DataVisualization (in System.Windows.Forms.DataVisualization.dll)

public class LegendCell : ChartNamedElement

The LegendCell type exposes the following members.

  NameDescription
Public methodLegendCell()Initializes a new instance of the LegendCell class.
Public methodLegendCell(String)Initializes a new instance of the LegendCell class with a text parameter that specifies the cell text or image name.
Public methodLegendCell(LegendCellType, String)Initializes a new instance of the LegendCell class with the specified cell type and a text parameter that specifies the cell text or image name.
Public methodLegendCell(LegendCellType, String, ContentAlignment)Initializes a new instance of the LegendCell class with the specified cell type, content alignment, and a text parameter that specifies the cell text or image name.
Top

  NameDescription
Public propertyAlignmentGets or sets the alignment of the legend cell contents.
Public propertyBackColorGets or sets the background color of the legend cell.
Public propertyCellSpanGets or sets the number of horizontal cells used to draw the contents of the legend cell.
Public propertyCellTypeGets or sets the legend cell type that is used to define the contents of the legend cell.
Public propertyFontGets or sets the font for the legend cell.
Public propertyForeColorGets or sets the text color of the legend cell.
Public propertyImageGets or sets the name of the image in a legend cell.
Public propertyImageSizeGets or sets the size of the image in a legend cell.
Public propertyImageTransparentColorGets or sets a color which will be replaced with a transparent color when the image is drawn.
Public propertyLegendGets the legend in which this cell belongs.
Public propertyLegendItemGets the legend item in which this cell belongs.
Public propertyMarginsGets or sets the margins of the legend cell.
Public propertyNameGets or sets the name of the legend cell. (Overrides ChartNamedElement.Name.)
Public propertySeriesSymbolSizeGets or sets the size of the series symbol that is displayed in the legend cell.
Public propertyTagGets or sets an object associated with this chart element. (Inherited from ChartElement.)
Public propertyTextGets or sets the legend cell text.
Public propertyToolTipGets or sets the tooltip text for the legend cell.
Top

  NameDescription
Public methodDispose()Releases the resources used by the ChartElement. (Inherited from ChartElement.)
Protected methodDispose(Boolean)Releases the unmanaged resources used by the LegendCell and optionally releases the managed resources. (Overrides ChartElement.Dispose(Boolean).)
Public methodEqualsDetermines whether the specified Object is equal to the current ChartElement. (Inherited from ChartElement.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns a hash function for a particular type. (Inherited from ChartElement.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current Object. (Inherited from ChartElement.)
Top

A legend is populated with legend items, which are represented by the LegendItemsCollection. These legend items consist of individual legend cells, which are in turn represented by the LegendCellCollection.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft