public GetLegendRectEventHandler  GetLegendRect

Remarks


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

You can use this event to force a 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


[C#]

private void tChart1_GetLegendRect(object sender, Steema.TeeChart.TChart.GetLegendRectEventArgs e) 
   {
      //Move entire Legend frame rectangle to left
      e.Rectangle=new Rectangle(e.Rectangle.Left-100,e.Rectangle.Top-20,e.Rectangle.Width,e.Rectangle.Height);
   }


private void tChart1_GetLegendPos(object sender, Steema.TeeChart.TChart.GetLegendPosEventArgs e)
   {
      //move Legend contents
      e.X=e.X-100;
      e.XColor=e.XColor-100;
   }

See Also

TChart Class | TChart Members | Steema.TeeChart Namespace