Legend in Tchart

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
jpm
Newbie
Newbie
Posts: 8
Joined: Tue Oct 06, 2015 12:00 am

Legend in Tchart

Post by jpm » Wed Jul 06, 2016 7:59 am

I would like to split a legend list in sevral apparent groups in order to have an easier overview
I would imagine either to add dividing line(s) ONLY at specific(s) location(s) and/or to change et vertical spacing only those positionns
Is it possible?
if Yes, how may I realize this/those local speration(s): I only found dividing line On/Off or Vertical Spacing value who are applied inbetween all the legend items.
if No, what could you suggest me to archive an equivatant result?
Thank you in advance for your answer.

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

Re: Legend in Tchart

Post by Yeray » Wed Jul 06, 2016 3:29 pm

Hello,

Have you seen the TExtraLegendTool?

Code: Select all

uses Series, TeeExtraLegendTool;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.AddSeries(TLineSeries).FillSampleValues(5);
  Chart1.AddSeries(TLineSeries).FillSampleValues(5);

  Chart1.Legend.LegendStyle:=lsValues;

  with Chart1.Tools.Add(TExtraLegendTool) as TExtraLegendTool do
  begin
    Series:=Chart1[1];

    Chart1.Draw;

    with Legend do
    begin
      CustomPosition:=True;
      Left:=Chart1.Legend.Left;
      Top:=Chart1.Legend.ShapeBounds.Bottom+10;
    end;
  end;
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