Chart.CustomizeLegend Event

.NET Framework (current version)

Occurs just before the chart legend is drawn. Use this event to customize the chart legend items.

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

member CustomizeLegend : IEvent<EventHandler<CustomizeLegendEventArgs>,

The CustomizeLegend event is primarily used to customize the legend just before it is drawn. Both default and custom legend items can be removed or modified, and custom items can also be added. In addition, the order of legend items can be changed.

The chart image can also be modified before being drawn by using the sender argument.

Note that a default legend item is an item that is created for either a data series or data point, but a custom legend item is not connected in any way to the chart data.

.NET Framework
Available since 4.0
Return to top