TeeChart - Legend Location and Size

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Lakshmi
Newbie
Newbie
Posts: 40
Joined: Fri Oct 07, 2005 4:00 am
Location: India
Contact:

TeeChart - Legend Location and Size

Post by Lakshmi » Fri Sep 22, 2006 11:00 am

Hi

In our application we are dependent on the legend location and size to position certain things on the graph.

We find that the legend location / size is not consitent. Sometimes we get correct values, sometimes its incorrect.

we use the following call :

chart.Legend.Left
chart.Legend.Top

To compute the
width = chart.Legend.Right - chart.Legend.Left
height = chart.Legend.Bottom - chart.Legend.Top

Please advise on how to ensure that the legend location/size is correct with tee chart.

Thanks

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Sep 22, 2006 11:58 am

Hi Lakshmi,

It could be that some of the times when you use this calls legend hasn't been painted yet and thus those properties don't have valid values. To solve that you can try a couple of options:

1. Making those calls in TeeChart's AfterDraw event.
2. Before making those calls make the one below to force the chart being internally painted.

Code: Select all

Bitmap bmp = tChart1.Bitmap;
You can also combine both options setting everything you want, calling Bitmap and putting the legend related code in the AfterDraw event.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply