I am having no joy creating a TDrawLineTool and placing it on the chart programmatically.
TrendLineTool := TDrawLineTool.Create(Chart1);
TrendLineTool.ParentChart := Chart1;
TrendLineTool.Series := Series1;
Chart1.Tools.Add(TrendLineTool);
x1 := Series1.CalcXPosValue(Read Saved Position from TInifile);
y1 := Series1.CalcYPosValue(Read Saved Position from TInifile);
x2 := Series1.CalcXPosValue(Read Saved Position from TInifile);
y2 := Series1.CalcYPosValue(Read Saved Position from TInifile);
TDrawLine.CreateXY(TrendLineTool.Lines,x1,y1,x2,y2);
with TrendLineTool do
begin
Name := 'WhatEver';
Pen.Width := 1;
Pen.Color := clRed;
end;
I use the exact same method to create TAnnotationTools and place them on the chart. No Problem. Why are my DrawLines not appearing on the Chart? I have placed the code in the Chart1.OnAfterDraw event. Still no joy.
Creating DrawLines in code at run time
Hi Phineas,
Have you seen the example at All features/Welcome !/Tools/Draw Line/Draw Line Tool? You should find all features demos at teechart's program group.
Have you seen the example at All features/Welcome !/Tools/Draw Line/Draw Line Tool? You should find all features demos at teechart's program group.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |