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
TeeChart - Legend Location and Size
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
You can also combine both options setting everything you want, calling Bitmap and putting the legend related code in the AfterDraw event.
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;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |