Real-time in Points series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Marco
Newbie
Newbie
Posts: 20
Joined: Fri Nov 15, 2002 12:00 am

Real-time in Points series

Post by Marco » Thu Jan 29, 2009 6:12 am

Hello,

we have got many problems with drawing 5000 points and more in a Points serie. If we add one point to the serie with already 5000 points, the CPU load gets about 90% and more.
We read the article "Real-time charting in TeeChart VCL" already. Unfortunately we are not able to use the faster serie "FastLineSerie" because we did not find any possibility to show the points directly without any line. So we have to use the Points series.
Is there any chance to add points to a given serie in real-time? we want / have to add a point every 150 ms. In the article you wrote that it is possible to show 1000000 points in a serie. This is correct but if you add the 1000001. point the CPU load gets to 100%. And if you add every 150 ms a point, you are not able to work with the application because the TChart's drawing needs to much CPU time.
Does somebody know any solution for our problem?
Thanks in advance
Best regards
Marco

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jan 29, 2009 11:17 am

Hi Marco,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Marco
Newbie
Newbie
Posts: 20
Joined: Fri Nov 15, 2002 12:00 am

Post by Marco » Mon Feb 02, 2009 5:35 am

Hello Narcis,

I sent you the example. It has the same name like our former problem.
With that sample we are ony able to add about 500 points, then our CPU load gets 100%.
Thank in advance.
Best regards
Marco

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Feb 02, 2009 9:01 am

Hi Marco,

Thanks for the example project but I'm not able to reproduce the issue here using TeeChart for .NET v3 release that was posted at the client area last Friday. Could you please check how it goes for you?

Here, after having plotted more than 5000 points the CPU load is stable around 30-35%. I'm doing the tests in a machine with an Intel Core 2 Quad 6600 CPU with 4 GB RAM and NVidia GeForce 8500 GT graphic card. Which are the characteristics of the machine you are doing the tests on? Have you tried the application in different machines? If so, do you get the same results?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Marco
Newbie
Newbie
Posts: 20
Joined: Fri Nov 15, 2002 12:00 am

Post by Marco » Mon Feb 02, 2009 9:50 am

Hello Narcis,

thank you very much for your testing.
I just tested the newest version of TChart 3.5.3317.17531.
But there is no difference between the versions.
We are using a production PC with a Intel Mobile Genuine with 1600 MHz and 1 GB RAM and a Intel 828852 graphic controller. We are not able to use a high-end PC because we are using this in machines in a production line.
We tested this sample also in our office PC with a Intel Core 2 Duo E6550 with 2 GB RAM and a Intel Q35 graphic contoller. Even there we get a CPU load about 60 %.
Do you know any other solution for our problem?
Thanks in advance
Best regards
Marco

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Feb 02, 2009 4:48 pm

Hi Marco,

Could you please send us your project's *.exe built in release mode so that we can compare it with ours?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Marco
Newbie
Newbie
Posts: 20
Joined: Fri Nov 15, 2002 12:00 am

Post by Marco » Tue Feb 03, 2009 5:17 am

Hello Narcis,

I sent you the release folder.
Thanks in advance
Best regards
Marco

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Feb 03, 2009 11:41 am

Hi Marco,

Thanks for your feedback. I get same behaviour using your *exe and TeeChart.dll and mine. We have run some more tests here and performance seems to be dependent upon the capacity of the video card on the machine.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Marco
Newbie
Newbie
Posts: 20
Joined: Fri Nov 15, 2002 12:00 am

Post by Marco » Wed Feb 04, 2009 7:13 am

Hello Narcis,

we have tested our example with three other PCs with different video cards. But we get always the same result. One time, with a Nvidia Geforce 7300, we could add about 1500 points but then our Dual Core CPU load gets about 60 %! This is definitely to high.

We are not able to use a high-end PC (like you used) for our production line. It is just an industrial PC.

Could you give me the system requirements for using TChart, please?

If these requirements are so high (Quad Core CPU with a Geforce 8500), it is a knock-out criterion for using TChart any longer (after 7 years!)

Thanks in advance
Best regards
Marco

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Feb 05, 2009 9:11 am

Hello Marco,

We have done more tests with your application in different machines and this uses quite a lot of CPU when it's loaded up a bit with points. Tests didn't reveal any clear problem to us. We wondered whether the constant redimensioning of the ValueLists played a major part so took that out by jumping arrays 500 points at a time before adding them. It didn't make a lot of difference whilst repaint frequency remains at the timer speed. It's the repaint then that takes up the time.

For this specific problem we'd say the paint frequency needs to be throttled. It can easily be varied to suit different machines. The paint indicator, the moving cursor tool, would need to be replaced as it's not so elegant when stepping, but in other respects painting every 2 points or 5 points doesn't make that much difference to the user perception. With 1 million points the paint cycle takes several (many) seconds, no realtime application that updates that quantity of points is going to be practical with this Series type.

For lesser point quantities delaying the timer cycle to wait for paints works ok.

eg. throttling:

Code: Select all

int cycle = 0; 

void _form1_timerArrived2(object sender, EventArgs e) 
{ 
  if (cycle == 1) 
  { 
    tChart1.AutoRepaint = false; 
  } 

  if (cycle < 10)  //<== varying this constant for CPU level required 
  { 
    this.points1.Add(_ran.Next(20), _ran.Next(200)); 
  } 
  else 
  { 
    tChart1.AutoRepaint = true; 
    tChart1.Invalidate(); 
    cycle = 0; 
  } 

  cycle++; 

  this.tChart1.Header.Text = points1.Count.ToString(); 
}

This test is going to use CPU as that's what's being asked of it. Recommendation, throttle/slowdown by taking out paint cycles or put the chart on an interruptable thread.

Another option would be that you used the DownSampling function as in the All Features\Welcome !\Functions\Extended\Reducing number of points example at the features demo, available at TeeChart's program group.

We will consider implementing an add method overload that adds (double[] x,double[] y, bool append). The current double[],double[] replaces existing data. We're incrementing the valuelist arraysize at every add for single doubles.

Also, a FastPoint series might be useful for this kind of charts.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Marco
Newbie
Newbie
Posts: 20
Joined: Fri Nov 15, 2002 12:00 am

Post by Marco » Thu Feb 05, 2009 10:57 am

Hello Narcis,

thanks a lot for your efforts!

We tested your solution: it could work!
In our measuring system every 150 ms a new point will arrive.
Ok, we could decide, if we have less than 500 points, we draw every point and if we have more than 500, we use your code snippet. And if we stop measuring a timer will show the last points in the serie.
But if we do not measure, a so called dynamic indication shows us the current point every 60 ms (in the same TChart control). For that we use the CursorTool, which is included in the example. So we need both CursorTool and Point Serie.
With the

Code: Select all

tChart1.AutoRepaint = false;
the CursorTool freezes.

That's why we have so a problem with the CPU load and why we are not able to use the downsampling function.
Our users also want to step through the serie to get the x- and y- value of each point and the description (as point's text).

So it would be wonderful, if you could implement your "FastPoint".
Do you think, there is a chance to get this "FastPoint" series in one of your next releases?
Thanks in advance!
Best regards
Marco

Marco
Newbie
Newbie
Posts: 20
Joined: Fri Nov 15, 2002 12:00 am

Post by Marco » Tue Feb 10, 2009 2:34 pm

Hello Narcis,

I am sorry for posting again.
But it would be helpful, if we could get any message about the chance to get this FastPoint serie in one of the next releases.
Thanks in advance
Best regards
Marco

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Feb 11, 2009 12:22 pm

Hello Marco,

I'm sorry about not being able to provide a more accurate answer but investigation needs to be done on this field. If this series is implemented it won't be until next TeeChart for .NET major release at the earliest.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Marco
Newbie
Newbie
Posts: 20
Joined: Fri Nov 15, 2002 12:00 am

Post by Marco » Thu Feb 12, 2009 2:17 pm

Hello Narcis,

thanks a lot!
Could you please let me know how often do you release a major version of TChart normally? (one every 6 month or one per year, etc.)

Because our customers want to see any result, so we have a lot of trouble. Otherwiese we have to throw TChart away and develop our own drawing control for our "problem".

Thanks in advance
Best regards!
Marco

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Feb 12, 2009 2:29 pm

Hi Marco,

You can see TeeChart's roadmap for 2009 here:

http://www.steema.com/files/public/Stee ... p_2009.pdf

You could also implement your custom series style derived from existing series. For example, you could try creating a series derived from FastLine series and override its Draw/DrawValue methods.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply