Source code change to procedure DrawLegendItem in Chart.pas

Ideas and wishes for TeeChart
Post Reply
dataview
Newbie
Newbie
Posts: 11
Joined: Fri Jun 15, 2007 12:00 am

Source code change to procedure DrawLegendItem in Chart.pas

Post by dataview » Tue Nov 06, 2007 7:07 pm

I found what I believe to be a bug in Chart.pas that affects the drawing of legend items when the legend is positioned at the top or bottom.

Change from:

if Vertical then
tmpSt:=Items[ItemOrder,t]
else
tmpSt:=Items[ItemOrder+(ITotalItems-ILastValue-1),t]; // v8 fix

Change to:

tmpSt:=Items[ItemOrder,t];

Because of the way that Items is populated, the same code should be used, regardless of the value of Vertical. The original code improperly displays the legend items, and can raise an exception when the FirstValue property is set.

Regards,

Bill

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

Post by Narcís » Wed Nov 07, 2007 8:32 am

Hi Bill,

Could you please send us a simple example project we can run "as-is" to reproduce the bug here?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance!
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

dataview
Newbie
Newbie
Posts: 11
Joined: Fri Jun 15, 2007 12:00 am

Post by dataview » Wed Nov 07, 2007 2:59 pm

I just uploaded ProjectChartTest.zip.

You will notice that everything works corectly when the legend is at the right, but incorrectly when the legend is at the bottom.

Once you apply my code change, it works correctly both ways.

Regards,

Bill

Post Reply