Skip to main content

TcxGridChartDiagram.OnCustomDrawLegendItem Event

Occurs when a legend item needs to be painted.

Declaration

property OnCustomDrawLegendItem: TcxGridChartDiagramLegendItemCustomDrawEvent read; write;

Remarks

The OnCustomDrawLegendItem event occurs every time a legend item (a legend key and its description, i.e. the display text of the series that corresponds to the legend item) needs to be painted. As with other custom draw events it provides a canvas for the grid control (the ACanvas parameter), ViewInfo (the AViewInfo parameter and its Bounds property) to get the bounding rectangle of the painted element (in this case the legend item). Sender is usually the element that caused the repaint. The ADone parameter’s value is initially False. Set it to True to prevent the grid control from performing default drawing painting over the custom painting performed.

Note

The Chart View’s OnCustomDrawLegendItem event can override the diagram’s OnCustomDrawLegendItem event since the former is fired after the latter.

To learn more about custom drawing, please refer to the Custom Draw topic.

See Also