lineseries and legend

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
JimR
Newbie
Newbie
Posts: 46
Joined: Mon Oct 24, 2016 12:00 am

lineseries and legend

Post by JimR » Fri Nov 17, 2017 4:01 am

How should a lineseries with no markers be displayed in the legend? I get markers when they are visible in the chart. However I would like a short line with the same color as the line in the chart when no markers are displayed. Ideal would be to have both lines and markers shown in the legend if both are visible in the chart. Suggestions?

Jim

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

Re: lineseries and legend

Post by Yeray » Fri Nov 17, 2017 12:15 pm

Hello Jim,

The legend shows line+pointer or only the line when applies for me here:
bds_2017-11-17_13-13-48.png
bds_2017-11-17_13-13-48.png (3.48 KiB) Viewed 15724 times
Am I misunderstanding anything?
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

JimR
Newbie
Newbie
Posts: 46
Joined: Mon Oct 24, 2016 12:00 am

Re: lineseries and legend

Post by JimR » Fri Nov 17, 2017 4:47 pm

Your example is what I want. Is there some option I need to set?

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

Re: lineseries and legend

Post by Yeray » Mon Nov 20, 2017 9:31 am

Hello,

I only created two TLineSeries, and made the Pointer one of them visible and smaller (to see its line better):

Code: Select all

uses Series;

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

  for i:=0 to 1 do
    with Chart1.AddSeries(TLineSeries) as TLineSeries do
    begin
      if i=0 then
      begin
        Pointer.Visible:=True;
        Pointer.Size:=2;
      end;

      FillSampleValues;
    end;
end;
Project2_2017-11-27_08-26-58.png
Project2_2017-11-27_08-26-58.png (2.82 KiB) Viewed 15643 times
Another option is to make the legend symbol not squared and wider:

Code: Select all

uses Series;

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

  for i:=0 to 1 do
    with Chart1.AddSeries(TLineSeries) as TLineSeries do
    begin
      if i=0 then
        Pointer.Visible:=True;

      FillSampleValues;
    end;

  Chart1.Legend.Symbol.Squared:=False;
  Chart1.Legend.Symbol.WidthUnits:=lcsPixels;
  Chart1.Legend.Symbol.Width:=25;
end;
Project2_2017-11-27_08-24-48.png
Project2_2017-11-27_08-24-48.png (3.9 KiB) Viewed 15645 times
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

JimR
Newbie
Newbie
Posts: 46
Joined: Mon Oct 24, 2016 12:00 am

Re: lineseries and legend

Post by JimR » Wed Nov 22, 2017 4:29 pm

I must have some wrong settings. I now do get lines and the symbols in the legend. The symbols are the correct colors but the lines are all black.

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

Re: lineseries and legend

Post by Yeray » Thu Nov 23, 2017 7:36 am

Hello,
JimR wrote:The symbols are the correct colors but the lines are all black.
Does it happen with the latest version (v2017.22) and the examples above?
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

JimR
Newbie
Newbie
Posts: 46
Joined: Mon Oct 24, 2016 12:00 am

Re: lineseries and legend

Post by JimR » Fri Nov 24, 2017 5:02 am

Yes, that is the version I am using.

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

Re: lineseries and legend

Post by Yeray » Mon Nov 27, 2017 7:28 am

Hello,
JimR wrote:Yes, that is the version I am using.
And do you get a different running the same code in the examples above?
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