Dundas Chart for ASP.NET
LegendItems Property
See Also  Example Send comments on this topic.
Dundas.Charting.WebControl Namespace > CustomizeLegendEventArgs Class : LegendItems Property


Enterprise Only Feature. Can be used to remove, modify, and change the order of both custom and default legend items. Custom items can also be added to the legend.


Legend items collection.

Syntax

Visual Basic (Declaration)  
Public ReadOnly Property LegendItems As LegendItemsCollection
Visual Basic (Usage) Copy Code
Dim instance As CustomizeLegendEventArgs
Dim value As LegendItemsCollection
 
value = instance.LegendItems
C#  
public LegendItemsCollection LegendItems {get;}

Return Value

LegendItemsCollection object.

Example

The following sample uses the LegendItems property to change the symbol color of the "Sales" series' legend item to red.
Visual Basic Copy Code
Imports Dundas.Charting.WebControl<CRLF>...<CRLF> <CRLF>Private Sub Chart1_CustomizeLegend(ByVal chart As Chart, ByVal e As CustomizeLegendEventArgs) Handles Chart1.CustomizeLegend<CRLF><CRLF> ' declare a LegendItem object<CRLF> Dim legendItem As LegendItem<CRLF> For Each legendItem In e.LegendItems<CRLF> If legendItem.SeriesName = "Sales" Then<CRLF> legendItem.Color = Color.Red<CRLF> End If<CRLF> Next<CRLF> <CRLF>End Sub

Remarks

This property allows for the deletion and customization of both default and custom legend items in the CustomizeLegend event. It can also be used to add custom legend items, and the order of legend entries can also be changed.

Note that the LegendItem.SeriesName and LegendItem.SeriesPointIndex properties can be used to determine the data element that a default legend item is associated with. These properties will be zero-length strings for custom items since custom items are not associated with chart data.


This property allows for the determination of the Legend that the event was raised for, enabling the customization of an individual Legend.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

Copyright © 2001 - 2009 Dundas Data Visualization, Inc. and others.