Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Chart FIFO

 Post Reply Post Reply
Author
Andreas Ziegler View Drop Down
New Member
New Member
Avatar

Joined: 02 Nov 2015
Posts: 1
Post Options Post Options   Quote Andreas Ziegler Quote  Post ReplyReply Direct Link To This Post Topic: Chart FIFO
    Posted: 01 Feb 2016 at 11:09am
Is there any way to have a FIFO behaviour in a LineChart? I want to delete the first point of the diagram and add another point. I tried the following:

(Chart 3 is the TChart and Std_dm is the TLineSeries. DataPoints is my "max" of desired data points in the diagram)

  if Std_dm.count > DataPoints then
  begin
    Std_dm.delete(0);
    Chart3.Update;
  end;
  Std_dm.Add(Value);



When I do this the following happens: http://www.dropbox.com/s/dht0tz4ycnpbob4/Charts.PNG?dl=0
It deletes with every run the first point and adds every new value at the Index "DataPoints".
A workaround is to clear the diagram and add a complete array. But this seems a little bit sloppy.

Best regards

Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3392
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 01 Feb 2016 at 1:43pm
If you are returning your points through the virtual method GetPoint and GetNumberOfPoints, then you need to wrap the code that removes a point with BeginUpdate / EndUpdate.

Kind Regards, 
Pieter
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down