TLegend.Title problem solved in latest patch??

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

TLegend.Title problem solved in latest patch??

Post by Johan Ingemansson » Tue Dec 06, 2005 10:03 am

Hi,

I posted a question regarding that the legend.title overlaps the legend border( last year I think), is this fixed in the latest version? This is really important to me since this problem has and are still causing major problems in my application. Would be grateful if anyone can propose a workaround.

Best Regards,

Johan Ingemansson

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 Dec 07, 2005 9:40 am

Hi Johan,

This bug hasn't been fixed yet. I increased its priority. In the meantime, a workaround is using:

Code: Select all

  Chart1.Legend.ColumnWidthAuto:=false;
  Chart1.Legend.ColumnWidths[0]:=70;
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

Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Title in TChartLegend

Post by Johan Ingemansson » Thu Dec 08, 2005 9:20 am

Hi again,

sry, but setting the ColumnWidths[0]:=70, doesnt work, the only workaround I´ve managed is to set the ColumnWidths[0]:=LegendTitleSize(I calculate this myself), and if the title width is greater then the chartwidth, its width is set to the chartwidht(otherwise it wont be displayed) and title is "choped" to fit.

The problem with this workaround is that since columnwidths[0] is rather wide, I only get one series title per row, if I have for example 8 series in chart, then the legend will be big and since I have a constant chart height, the size for the graphical display is reduced significantly :(

Best Regards,

Johan Ingemansson

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Sat Dec 17, 2005 1:18 pm

Hi Johan,

it's working fine now, using the latest TeeChart Pro v7.06 available to download from the customers download page on our web site.

Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

TLegend.Title

Post by Johan Ingemansson » Mon Dec 19, 2005 1:27 pm

Hi again,

You said that this bug was fixed in 7.06 but I have installed this patch and my conclusions is that TLegend.Title doesnt adjust for the TLegend.border, i.e if the title is wider then the border, it will overlap the border. If anyone have any solid workaround for this bug, I would be grateful.

Best Regards,

Johan Ingemansson

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Dec 27, 2005 10:37 am

Hi Johan,

how can you reproduce the problem ? Would you be so kink to post post the code you're using ?

Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Post by Johan Ingemansson » Mon Jan 02, 2006 10:17 am

This is the code I use for creating the legend:

with Legend do
begin
Alignment:=laBottom;
Font.Size:=10;
Font.Pitch:=fpFixed;
LegendStyle:=lsSeries;
Font.Name:='Arial';
ShadowColor:=clNone;
ShadowSize:=0;
Title.Text.Text

Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Title in TChartLegend

Post by Johan Ingemansson » Mon Jan 02, 2006 10:22 am

Hi again,

This is the code I use for creating the legend:

with Legend do
begin
Alignment:=laBottom;
Font.Size:=10;
Font.Pitch:=fpFixed;
LegendStyle:=lsSeries;
Font.Name:='Arial';
ShadowColor:=clNone;
ShadowSize:=0;
Title.Text.Text:=ATextString(will max be 255 char long)
end;

[/img]

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jan 02, 2006 11:46 am

Hi Johan,

yes, you're correct, I'm sorry, did not test it with the alignment. It's a bug which we'll try to fix asap, for the next maintenance release.
In meantime if the workaround you said does not help you so much, another option could be to hide the Frame of the Legend and draw it manually in the OnBeforeDrawChart event, using similar code to the following :

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
with Chart1.Legend do
begin
Alignment:=laBottom;
Font.Size:=10;
Font.Pitch:=fpFixed;
LegendStyle:=lsSeries;
Font.Name:='Arial';
ShadowColor:=clNone;
ShadowSize:=0;
Frame.Visible := false;
title.Text.Text:='aaaaaa  a a  a aa a  aaaa aa a  a a aaaaaaaa aaaaaaaaaaaaa  aaaaa a a a  aaaaaaaaaa';
Chart1.Draw();
end;

end;

procedure TForm1.Chart1BeforeDrawChart(Sender: TObject);
var rl : trect;
begin
Chart1.Canvas.Pen.Color := clblue;
Chart1.Canvas.Brush.Style := bsSolid;
rl :=Chart1.Legend.RectLegend;
rl.Top := rl.Top -1;
rl.Right := rl.Right +75;
rl.left := rl.left -1;
Chart1.Canvas.Rectangle(rl);
end;

Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Next Release?

Post by Johan Ingemansson » Wed Jan 04, 2006 11:04 am

Hi again,

One quick question, what date is the next release scheduled for?

Best Regards,

Johan Ingemansson

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Jan 05, 2006 10:02 am

Hi Johan,

I cannot tell a fixed date, but I think the new v7.07 will be out on this month (Jan), which will include some fixes, and sure thing is that will include the fix for this problem as it has been fixed yet.

Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

When is patch 7.07 coming?

Post by Johan Ingemansson » Fri Feb 17, 2006 8:28 am

Hi again,

Just wondering, in previous post it was said that the next patch should be out in end of Jan, I still havent seen it. Has this patch been delayed, and when is it scheduled for?

Best Regards,

Johan Ingemansson

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 Feb 17, 2006 10:07 am

Hi Johan,

Yes, there is a TeeTree installing issue that needs to be fixed before and we are currently working on it. As soon as this is fixed the next maintenance release will be published.

Please be aware at those forums for further news.
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