TeeChart 2013 and Legend Symbol Size

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Errol
Newbie
Newbie
Posts: 75
Joined: Thu Jul 11, 2013 12:00 am

TeeChart 2013 and Legend Symbol Size

Post by Errol » Tue Feb 18, 2014 4:53 am

With TeeChart 8, the symbol size in the legend of line graphs matched the symbol size used in the graph, up to a maximum 5x5 symbol. See the attached images tagged with TeeChart8. With TeeChart 2013, however, the symbol size is always at one large size and very wide, especially for our multiple graphs (see images tagged with TeeChart2013). I tracked the cause of the problem down to a change in the parameters for the Pointer.DrawPointer command in TeePointerDrawLegend in series.pas.

When I replaced this with the parameters fromTeeChart8, the legend symbol is now drawn correctly. Will Steema restore the DrawPointer parameters to those in TeeChart 8, or do I have to write some overloaded procedure in my code to obtain the output I require. If the latter, can you please indicate where I would need to introduce the overloaded procedure as the TeePointerDrawLegend is deep within the TeeChart code.

MultipleGraph_TeeChart8.png
MultipleGraph_TeeChart8.png (60 KiB) Viewed 6060 times
QuickGraph_TeeChart2013.png
QuickGraph_TeeChart2013.png (32.45 KiB) Viewed 6034 times
MultipleGraph_TeeChart2013.png
MultipleGraph_TeeChart2013.png (47.39 KiB) Viewed 6041 times

Code: Select all

Procedure TeePointerDrawLegend(const Pointer:TSeriesPointer; AColor:TColor;
                               Const Rect:TRect; DrawPen:Boolean;
                               AStyle:TSeriesPointerStyle);
var tmpHoriz : Integer;
    tmpVert  : Integer;
    tmpPenW  : Integer;
    tmpX     : Integer;
    tmpY     : Integer;
    tmp      : Integer;
begin
  if Assigned(Pointer.ParentChart) then
  begin

// code

// replaced this expression in TeeChart2013 version
{      Pointer.DrawPointer(Pointer.ParentChart.Canvas,
                          False,
                          tmpX,
                          tmpY,
                          tmpHoriz, //Math.Min(Pointer.HorizSize,tmpHoriz),
                          tmpVert, //Math.Min(Pointer.VertSize,tmpVert),
                          AColor,AStyle);}

// with this one from TeeChart 8
      Pointer.DrawPointer(Pointer.ParentChart.Canvas,
                          False,
                          tmpX,
                          tmpY,
                          Math.Min(Pointer.HorizSize,tmpHoriz),
                          Math.Min(Pointer.VertSize,tmpVert),
                          AColor,AStyle);
    end;
  end;
end;

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

Re: TeeChart 2013 and Legend Symbol Size

Post by Narcís » Wed Feb 19, 2014 3:33 pm

Hi Errol,

This has been improved in our current sources. We are finalizing the details for a new maintenance release. We expect it to be out before the end of the month. What I get with our internal sources is this:
PointerSymbols.jpg
PointerSymbols.jpg (73.86 KiB) Viewed 6008 times
Is this similar to what you'd expect?

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

Errol
Newbie
Newbie
Posts: 75
Joined: Thu Jul 11, 2013 12:00 am

Re: TeeChart 2013 and Legend Symbol Size

Post by Errol » Wed Feb 19, 2014 8:08 pm

Hi Narcis

Yes this looks similar to what I expect, except I would like to also see the line colour and line type in the legend as a line through the symbol (usually shorter than that shown in MultipleGraph_TeeChart8.png - our Multiple Graph legends are coded). I'll stay with the Source Code change at the moment until your maintenance release comes out, and then see if I have to develop an override version of TeePointerDrawLegend.

Thanks and regards

Errol

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

Re: TeeChart 2013 and Legend Symbol Size

Post by Narcís » Thu Feb 20, 2014 8:23 am

Hi Errol,

Thanks for your feedback. Also feel free to submit your functionality requests at Steema Software's bugzilla platform: http://bugs.teechart.net/
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

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeChart 2013 and Legend Symbol Size

Post by Yeray » Thu Feb 20, 2014 8:50 am

Hi Errol,
Errol wrote:Yes this looks similar to what I expect, except I would like to also see the line colour and line type in the legend as a line through the symbol (usually shorter than that shown in MultipleGraph_TeeChart8.png - our Multiple Graph legends are coded). I'll stay with the Source Code change at the moment until your maintenance release comes out, and then see if I have to develop an override version of TeePointerDrawLegend.
Note you can widen the legend symbol through the Legend.Symbol.Width property. Ie:

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.View3D:=false;

  for i:=0 to 2 do
  begin
    with Chart1.AddSeries(TLineSeries) as TLineSeries do
    begin
      FillSampleValues;
      Pointer.Visible:=true;
      Pointer.Style:=TSeriesPointerStyle(i);
    end;
  end;

  Chart1.Legend.Alignment:=laBottom;
  Chart1.Legend.Symbol.Width:=50;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply