ITChart.OnGetLegendRect
ITChart

property OnGetLegendRect: TTChartOnGetLegendRect;

Type Library
TeeChartx

Description
An OnGetLegendRect event occurs whenever the TChart Legend is going to be displayed.

You can use this event to force an specific Legend position and dimensions.

The Rect parameter determines the default Legend position and dimensions in screen pixels.

After drawing the Legend, the available Chart space will be decreased to not overlap with Legend unless you set the Legend.ResizeChart property to False.

When using this event you'll need to use the TChart.OnGetLegendPos event as well, to supply the exact coordinates for the Legend contents.

Example [Visual Basic]:

Private Sub TChart1_OnGetLegendRect(Left As Long, Top As Long, Right As Long, Bottom As Long)

'Move Legend Rectangle

Left = Left - 10

Top = Top - 5

Right = Right - 10

Bottom = Bottom + 5

End Sub