Page 1 of 1

Can te widht of the legend box be found?

Posted: Fri Apr 16, 2004 10:38 am
by 6927410
Hello.

I need to right align the legend box in the charts right upper corner. To do so I need to know the legend width to be able to calculate the desired Legend.Left. Can the with be found in code?

Best Regards,
Ragnar

Posted: Sun Apr 18, 2004 5:23 pm
by Pep
Hi Ragnar,

yes, you can use the OnGetLegendRect event :

Code: Select all

Private Sub TChart1_OnGetLegendRect(Left As Long, Top As Long, Right As Long, Bottom As Long)
 Height = Bottom - Top 
 Width = Right - Left
End Sub