Page 1 of 1

XY-Plot Question

Posted: Fri Sep 09, 2005 3:53 pm
by 9523585
I am trying to do a real-time XY Plot where the XY Plot displays like the last 5 minutes of data and updates every 10 seconds with the new point being added and the oldest point being removed. At first it seemed like a very simple solution where I just Delete(0) on the series after I do an AddXY(). The problem is that the series gets reordered after every AddXY(), so Delete(0) removes the smallest value instead of the oldest value. Any thoughts on how to get around this??
Thanks in advance!

Posted: Mon Sep 12, 2005 8:34 am
by narcis
Hi TMECHAM,

This is most likely you are ordering your series somewhere in your code or else this shoudn't happen. Another method you could use instead of Clear is Delete but I guess if values are ordered it will behave the same way.

For more information on how to optimize TChart performance with real-time charting please read this article. Even though is written in Delphi it can be applied to any other TeeChart version.

If you can't solve your problem, could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.

Posted: Mon Oct 03, 2005 7:16 pm
by 9523585
Hello,
I posted a sample project a couple weeks ago on the attachments forum demonstrating the problem. It is titled "Real time XYPlot". I forgot to reply here when I posted the project, so I figured I better do so now.
Thanks!

Posted: Wed Oct 05, 2005 7:58 am
by narcis
Hi TMECHAM,

Thanks for advising. To solve this problem you just need to set order to loNone:

Code: Select all

tchart1.Series(0).XValues.Order = loNone
tchart1.Series(1).XValues.Order = loNone

Posted: Wed Oct 05, 2005 2:26 pm
by 9523585
That's exactly what I was looking for!! Thanks a ton :)

Posted: Wed Oct 05, 2005 2:45 pm
by narcis
You're welcome :D! I'm glad to hear that helped.