Chart.CustomizeLegend Event

Definition

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

public:
 event EventHandler<System::Web::UI::DataVisualization::Charting::CustomizeLegendEventArgs ^> ^ CustomizeLegend;
public event EventHandler<System.Web.UI.DataVisualization.Charting.CustomizeLegendEventArgs> CustomizeLegend;
member this.CustomizeLegend : EventHandler<System.Web.UI.DataVisualization.Charting.CustomizeLegendEventArgs> 
Public Custom Event CustomizeLegend As EventHandler(Of CustomizeLegendEventArgs) 

Event Type

Remarks

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.

Applies to