TCustomChart.OnGetLegendRect
TCustomChart
property OnGetLegendRect: TOnGetLegendRect;
Unit
Chart
Description
An OnGetLegendRect event occurs whenever the Chart TCustomChart.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 TCustomChartLegend.ResizeChart property to False.
When using this event you'll need to use the TChart TCustomChart.OnGetLegendPos event as well, to supply the exact coordinates for each Legend item.