Dundas Chart for ASP.NET
CustomizeLegendEventHandler Delegate
See Also  Example Send comments on this topic.
Dundas.Charting.WebControl Namespace : CustomizeLegendEventHandler Delegate


sender

The root Chart object.

e

A CustomizeLegendEventArgs object, used to modify the legend.

Enterprise Edition Only Feature. Represents the method that will handle the CustomizeLegend event of the Chart.
Chart customize legend event handler delegate.

Syntax

Visual Basic (Declaration)  
Public Delegate Sub CustomizeLegendEventHandler( _
   ByVal sender As Chart, _
   ByVal e As CustomizeLegendEventArgs _
) 
Visual Basic (Usage) Copy Code
Dim instance As New CustomizeLegendEventHandler(AddressOf HandlerMethod)
C#  
public delegate void CustomizeLegendEventHandler( 
   Chart sender,
   CustomizeLegendEventArgs e
)

Parameters

sender

The root Chart object.

e

A CustomizeLegendEventArgs object, used to modify the legend.

Example

 

The following sample changes the symbol color of the "Sales" series' legend item to red in the "Default" Legend.

Visual Basic Copy Code
Private Sub Chart1_CustomizeLegend(ByVal chart As Chart, ByVal e As CustomizeLegendEventArgs) _ Handles Chart1.CustomizeLegend If e.Name = "Default" Then 'declare a LegendItem object Dim legendItem As LegendItem For Each legendItem In e.LegendItems If legendItem.SeriesName = "Sales" Then legendItem.Color = Color.Red End If Next End If End Sub

Remarks

The declaration of your event handler must have the same parameters as the CustomizeLegendEventHandler delegate declaration.

When you create a CustomizeLegendEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.

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.