LegendItem Class
TOC
Collapse the table of content
Expand the table of content

LegendItem Class

.NET Framework (current version)
 

Represents a legend item, which is stored in the LegendItemsCollection class.

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


public class LegendItem : ChartNamedElement, IChartMapArea

NameDescription
System_CAPS_pubmethodLegendItem()

Initializes a new instance of the LegendItem class.

System_CAPS_pubmethodLegendItem(String, Color, String)

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

NameDescription
System_CAPS_pubpropertyBackGradientStyle

Gets or sets the orientation for the background gradient of a legend item. Also determines whether a gradient is used.

System_CAPS_pubpropertyBackHatchStyle

Gets or sets the hatching style of a legend item.

System_CAPS_pubpropertyBackImageTransparentColor

Gets or sets a color which will be replaced with a transparent color when the background image is drawn.

System_CAPS_pubpropertyBackSecondaryColor

Gets or sets the secondary color of a legend item.

System_CAPS_pubpropertyBorderColor

Gets or sets the border color of a legend item.

System_CAPS_pubpropertyBorderDashStyle

Gets or sets the border style of a legend item.

System_CAPS_pubpropertyBorderWidth

Gets or sets the border width of a legend item.

System_CAPS_pubpropertyCells

Gets the collection of cells in the legend item.

System_CAPS_pubpropertyColor

Gets or sets the color of a legend item.

System_CAPS_pubpropertyEnabled

Gets or sets a flag that indicates whether the legend item is enabled.

System_CAPS_pubpropertyImage

Gets or sets the image that will be displayed for a legend item symbol.

System_CAPS_pubpropertyImageStyle

Gets or sets the display style of the legend item image.

System_CAPS_pubpropertyLegend

Gets or sets the Legend object associated with this legend item.

System_CAPS_pubpropertyMapAreaAttributes

Gets or sets the map area attributes of a legend item.

System_CAPS_pubpropertyMarkerBorderColor

Gets or sets the border color of the markers, if used.

System_CAPS_pubpropertyMarkerBorderWidth

Gets or sets the border width of the markers, if used. Measured in pixels.

System_CAPS_pubpropertyMarkerColor

Gets or sets the color of the markers, if used.

System_CAPS_pubpropertyMarkerImage

Gets or sets a marker image.

System_CAPS_pubpropertyMarkerImageTransparentColor

Gets or sets a color that will be replaced with a transparent color when the marker image is drawn.

System_CAPS_pubpropertyMarkerSize

Gets or sets the size of the legend item markers, if used.

System_CAPS_pubpropertyMarkerStyle

Gets or sets a legend item marker style. Also used to enable or disable the display of markers.

System_CAPS_pubpropertyName

Gets or sets the name of the legend item.(Overrides ChartNamedElement.Name.)

System_CAPS_pubpropertyPostBackValue

Gets or sets the postback value which can be processed on a Click event.

System_CAPS_pubpropertySeparatorColor

Gets or sets the color of the legend item separator.

System_CAPS_pubpropertySeparatorType

Gets or sets the separator style of the legend item.

System_CAPS_pubpropertySeriesName

Gets or sets the name of the Series associated with a default legend item.

System_CAPS_pubpropertySeriesPointIndex

Gets or sets the index of a DataPoint object associated with a default legend item.

System_CAPS_pubpropertyShadowColor

Gets or sets the shadow color of a legend item.

System_CAPS_pubpropertyShadowOffset

Gets or sets the shadow offset, in pixels, of a legend item.

System_CAPS_pubpropertyTag

Gets or sets an object associated with this chart element.(Inherited from ChartElement.)

System_CAPS_pubpropertyToolTip

Gets or sets the tooltip of the legend item.

System_CAPS_pubpropertyUrl

Gets or sets the destination URL of a legend item.

NameDescription
System_CAPS_pubmethodDispose()

Releases the resources used by the ChartElement.(Inherited from ChartElement.)

System_CAPS_protmethodDispose(Boolean)

Releases the unmanaged resources used by the LegendItem class and optionally releases the managed resources.(Overrides ChartElement.Dispose(Boolean).)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified Object is equal to the current ChartElement.(Inherited from ChartElement.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Returns a hash function for a particular type.(Inherited from ChartElement.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current Object.(Inherited from ChartElement.)

The LegendItem class represents a legend item, which can be either a default or custom item:

  • Default legend items are automatically inserted into the legend for either data series or data points. Default entries for pie and doughnut charts represent the plotted data points, whereas entries for all other chart types represent the plotted series. By default, these legend entries use the data point or series color for the symbol color, and the name of the series or data point for the legend item text. Default legend items can be customized or deleted at run time by using the CustomizeLegend event of the Chart control.

  • Custom legend items have user-defined text, symbol color, and so forth. Unlike the default entries, they are not connected with the plotted data. Custom legend items can be added at either design time or run time, using the CustomItems property of the Legend object.

Legend symbols can be rectangles, lines or markers, depending on the ImageStyle property setting of a LegendItem object.

The text of a custom legend item is determined by the Name property.

.NET Framework
Available since 4.0

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

Return to top
Show:
© 2016 Microsoft