Page 1 of 1

Dynamically positioning a TArrowTool

Posted: Fri Feb 02, 2018 12:17 pm
by 10047857
Hi

I've searched your archives but find no reference to the TArrowTool.

I have placed a number of arrow tools in a chart like this:-
2018-02-02_120718.png
2018-02-02_120718.png (40.22 KiB) Viewed 7087 times
On resizing the chart I want the arrows to remain right-aligned and I though that this code would do it but it causes an exception.

Code: Select all

procedure TfmCorrelationGraph.ChartAfterDraw(Sender: TObject);
var
  pt1 : TPointXY;
  pt2 : TPointXY;
begin
  pt1.X:=Chart.Width-120;
  pt1.Y:=16;
  pt2.X:=Chart.Width-80;
  pt2.Y:=16;

  ChartTool8.FromPoint:=pt1;
  ChartTool8.ToPoint:=pt2;
end;
Is it possible?

Bruce.

Re: Dynamically positioning a TArrowTool

Posted: Tue Feb 06, 2018 9:11 am
by yeray
Hello Bruce,

You can use just this:

Code: Select all

procedure TfmCorrelationGraph.ChartAfterDraw(Sender: TObject);
begin
  ChartTool8.FromPoint.Point:=Point(Chart1.Width-120, 16);
  ChartTool8.ToPoint.Point:=Point(Chart1.Width-80, 16);
end;