Page 1 of 1

TeeChart 2013 and Legend Symbol Size

Posted: Tue Feb 18, 2014 4:53 am
by 16566546
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 6105 times
QuickGraph_TeeChart2013.png
QuickGraph_TeeChart2013.png (32.45 KiB) Viewed 6079 times
MultipleGraph_TeeChart2013.png
MultipleGraph_TeeChart2013.png (47.39 KiB) Viewed 6086 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;

Re: TeeChart 2013 and Legend Symbol Size

Posted: Wed Feb 19, 2014 3:33 pm
by narcis
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 6053 times
Is this similar to what you'd expect?

Thanks in advance.

Re: TeeChart 2013 and Legend Symbol Size

Posted: Wed Feb 19, 2014 8:08 pm
by 16566546
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

Re: TeeChart 2013 and Legend Symbol Size

Posted: Thu Feb 20, 2014 8:23 am
by narcis
Hi Errol,

Thanks for your feedback. Also feel free to submit your functionality requests at Steema Software's bugzilla platform: http://bugs.teechart.net/

Re: TeeChart 2013 and Legend Symbol Size

Posted: Thu Feb 20, 2014 8:50 am
by yeray
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;