Page 1 of 1

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

Posted: Mon Jan 27, 2014 3:14 pm
by 16467044
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

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

Posted: Wed Jan 29, 2014 3:41 pm
by yeray
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.

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

Posted: Thu Jan 30, 2014 2:37 pm
by 16467044
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

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

Posted: Mon Feb 03, 2014 12:35 pm
by yeray
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.