ChartTool_TL.Lines.AddLine() // does not show up

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Chartist
Newbie
Newbie
Posts: 60
Joined: Wed Sep 18, 2013 12:00 am

ChartTool_TL.Lines.AddLine() // does not show up

Post by Chartist » Mon Jan 27, 2014 3:14 pm

Hi,

I have added the Tool "TDrawLineTool" and draw lines into my chart. Works fine
Now I want to draw a parallel line to an existing line.

I do not know, if it is the best choice, but I tried by:

Code: Select all

myFunction;
Var x, x1, y, y1: double;
begin
  x:=trunc(ChartTool_TL.Selected.X0); x1:=trunc(ChartTool_TL.Selected.X1);
  y:=ChartTool_TL.Selected.y0; y1:=ChartTool_TL.Selected.Y1;
  ChartTool_TL.Lines.AddLine(x + 2, x1 + 2, y*1.0001, y1*1.0001);
end;
my problem: I cannot see my new lines.
As the count of the lines increases, I think, they are there, but not visible.
I tried to "add" other lines as well. They increase the line count as well, but I cannot see them neither.

What can I do?
I tried repaint and refresh without success.

Cheryll
Cheryll

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

Re: ChartTool_TL.Lines.AddLine() // does not show up

Post by Yeray » Wed Jan 29, 2014 3:41 pm

Hello Cheryll,

Here it is the definition of the AddLine method:

Code: Select all

function TDrawLines.AddLine(const X0,Y0,X1,Y1:Double):TDrawLine;
As you can see the parameters are X0,Y0,X1,Y1. Note you are adding the parameters in a different order: X0,X1,Y0,Y1.
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

Chartist
Newbie
Newbie
Posts: 60
Joined: Wed Sep 18, 2013 12:00 am

Re: ChartTool_TL.Lines.AddLine() // does not show up

Post by Chartist » Thu Jan 30, 2014 2:37 pm

Hello Yeray,

thank you for your answer.

I added the line in a different way and all combinations of values - I cannot see any other line, which I drew by code.
The increased count-value suggests, that the lines exist.

Sincerely,
Irene
Cheryll

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

Re: ChartTool_TL.Lines.AddLine() // does not show up

Post by Yeray » Mon Feb 03, 2014 12:35 pm

Hi Cheryll,

It seems to work fine for me in a simple example project with just a chart, a TPointSeries and a TDrawLine tool in it.
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
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