Microsoft Chart Control for .NET Framework supports a large number of events, giving developers
many different ways to customize their charts.
All events are made available by the Chart object. The name of the event usually indicates the nature of the event and the object to which it applies, such as the AxisScrollBarClicked event.
There are two special events that allow for custom painting: PrePaint and PostPaint. The PrePaint event is triggered just before the Chart object is painted, and the PostPaint event is triggered just after the chart is painted. Use these events for custom painting. The figure below demonstrates using PostPaint to place an image in the chart picture.
Another important event is the Customize event, which has two unique characteristics:
The following lists chart elements that have one or more associated events:
Chart Element | Related Events |
---|---|
Chart | PrePaint, PostPaint, Customize, CustomizeMapAreas |
Legend | CustomizeLegend |
multiple elements | Click |