creation of polyline through code

Hi,

I want to create a polyline on runtime through code. Problem is that it takes the points when creating the polyline (from 0,0 to 100,50). Refresh of the diagram or polyline doesn't resolve the problem.
 
This is my example
   SetLength(Pts, 4);
   pts[0] := Dot(49,115);
   pts[1] := Dot(151,179);
   pts[2] := Dot(191,124);
   pts[3] := Dot(212,84);

   //Test
     curDataBlock := TDiagramPolyLine.Create(Self);
     with curDataBlock do
     begin
        Points := pts;
        Diagram := DrawLayer;
     end;
 
Thanks for the support
Geert
 

Hello, 

this is the way it will work (use Handles property):

     curDataBlock := TDiagramPolyLine.Create(Self);
     with curDataBlock do
     begin
        Handles.Clear;
        Handles.Add.OrPoint := Dot(49,115);
        Handles.Add.OrPoint := Dot(151,179);
        Handles.Add.OrPoint := Dot(191,124);
        Handles.Add.OrPoint := Dot(212,84);
        Diagram := DrawLayer;
     end;

Perfect!

Thx for the quick reply
Geert