Adding points from another thread
Adding points from another thread
Hi all,
I have a problem with my application. In it, I add points to my chart from another thread. This doesn't cause a problem in itself, only that the chart doesn't repaint itself automatically. You can only see the added points when you resize the window, or when you move the focus from the window and back again (causing it to repaint).
One method I have found out of this problem is to call tChart.Refresh() on the GUI thread every time a point is added, but since I have six charts, this takes up quite a lot of CPU (20% on a 2.00Ghz processor).
Does anyone know how I can make the charts repaint themselves? Settings AutoRepaint = true doesn't work either.
There's a small app on the upload page which demonstrates my problem, called TestHorizLine.zip.
Thanks in advance for any response,
Frances
I have a problem with my application. In it, I add points to my chart from another thread. This doesn't cause a problem in itself, only that the chart doesn't repaint itself automatically. You can only see the added points when you resize the window, or when you move the focus from the window and back again (causing it to repaint).
One method I have found out of this problem is to call tChart.Refresh() on the GUI thread every time a point is added, but since I have six charts, this takes up quite a lot of CPU (20% on a 2.00Ghz processor).
Does anyone know how I can make the charts repaint themselves? Settings AutoRepaint = true doesn't work either.
There's a small app on the upload page which demonstrates my problem, called TestHorizLine.zip.
Thanks in advance for any response,
Frances
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Frances,
Thanks for the example, using RefreshSeries instead of AutoRepaint works fine here:
Hope this helps!
Thanks for the example, using RefreshSeries instead of AutoRepaint works fine here:
Code: Select all
private void StartTimer()
{
while (true)
{
y += random.NextDouble();
horizLine1.Add(random.Next(20), y);
//tChart1.AutoRepaint = true;
horizLine1.RefreshSeries();
Thread.Sleep(1000);
}
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Narcís,
thanks for the quick reply, but unfortunately your example code doesn't work for me. When I use this code:
My chart doesn't show it's added points until I resize / refocus the window
thanks for the quick reply, but unfortunately your example code doesn't work for me. When I use this code:
Code: Select all
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace TestHorizLine
{
public partial class Form1 : Form
{
private double y = 2;
private Random random = new Random();
private Thread thread;
public Form1()
{
InitializeComponent();
horizLine1.Add(0, 0);
horizLine1.Add(1, 1);
horizLine1.Add(2, 2);
}
private void Form1_Load(object sender, EventArgs e)
{
thread = new Thread(new ThreadStart(StartTimer));
thread.Start();
}
protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
thread.Abort();
}
private void StartTimer()
{
while (true)
{
y += random.NextDouble();
horizLine1.Add(random.Next(20), y);
horizLine1.RefreshSeries();
Thread.Sleep(1000);
}
}
}
}
My chart doesn't show it's added points until I resize / refocus the window
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Frances,
It works fine for me here using latest TeeChart for .NET v3 release available at the client area.
Which TeeChart version are you using?
Thanks in advance.
It works fine for me here using latest TeeChart for .NET v3 release available at the client area.
Which TeeChart version are you using?
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Frances,
As I told in my previous reply, it works fine for me here using the very same TeeChart version as you. I'm going to send the application .exe file I created here. Could you please replace your current .exe file for the one I send and let us know if it works fine at your end?
Also find below an excerpt of the Visual Studio version I used here. Which version are you using?
Microsoft Visual Studio 2005
Version 8.0.50727.762 (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727 SP1
Installed Edition: Professional
Microsoft Visual C# 2005 77626-009-0000007-41978
Thanks in advance.
As I told in my previous reply, it works fine for me here using the very same TeeChart version as you. I'm going to send the application .exe file I created here. Could you please replace your current .exe file for the one I send and let us know if it works fine at your end?
Also find below an excerpt of the Visual Studio version I used here. Which version are you using?
Microsoft Visual Studio 2005
Version 8.0.50727.762 (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727 SP1
Installed Edition: Professional
Microsoft Visual C# 2005 77626-009-0000007-41978
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 |
Instructions - How to post in this forum |
Hi Narcís,
thanks for sending me the exe, but unfortunately my e-mail at work rejects it because of our e-mail policy. Could you please send it to the changed e-mail address defined in my profile?
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727
Installed Edition: Professional
Microsoft Visual C# 2005 77626-009-0000007-41804
thanks for sending me the exe, but unfortunately my e-mail at work rejects it because of our e-mail policy. Could you please send it to the changed e-mail address defined in my profile?
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727
Installed Edition: Professional
Microsoft Visual C# 2005 77626-009-0000007-41804
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Frances,
Sure, no problem, I've just send it again. If e-mailing that sort of files is a problem at your end I could also upload them at our website for you to download.
BTW: It seems your Visual Studio is not up to date. You could try installing updates/service packs available to see if it makes a difference.
Sure, no problem, I've just send it again. If e-mailing that sort of files is a problem at your end I could also upload them at our website for you to download.
BTW: It seems your Visual Studio is not up to date. You could try installing updates/service packs available to see if it makes a difference.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Narcís,
apparently, we're using different TChart versions. When I try to run your exe (in the same folder which contains my TeeChart.dll), I get this error:
Could not load file or assembly 'TeeChart, Version=3.0.2895.23856, Culture=neutral, PublicKeyToken=9c8126276c77bdb7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
My version is 3.2.2868.26903
By the way, I can't install VS SP1, it causes some bugs with our software which we don't have the time to resolve.
apparently, we're using different TChart versions. When I try to run your exe (in the same folder which contains my TeeChart.dll), I get this error:
Could not load file or assembly 'TeeChart, Version=3.0.2895.23856, Culture=neutral, PublicKeyToken=9c8126276c77bdb7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
My version is 3.2.2868.26903
By the way, I can't install VS SP1, it causes some bugs with our software which we don't have the time to resolve.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Frances,
Sorry, my bad, I build the application using the maintenance release sources but forgot to change the build number.
I have sent you a new .exe. Could you please try now and let me know how it goes?
Thanks in advance.
Sorry, my bad, I build the application using the maintenance release sources but forgot to change the build number.
I have sent you a new .exe. Could you please try now and let me know how it goes?
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Frances,
Thanks for the information. Could you please now build the same .exe at your end and send it to us?
Thanks in advance.
Thanks for the information. Could you please now build the same .exe at your end and send it to us?
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Frances,
Sorry but this is an obsolete e-mail address as we don't provide direct e-mail support except for the Pro-Support subscribers. You should have received an automatic reply letting you know about our standard support channels.
Could you please send the file at news://www.steema.net/steema.public.attachments newsgroup or at our upload page?
Thanks in advance.
Sorry but this is an obsolete e-mail address as we don't provide direct e-mail support except for the Pro-Support subscribers. You should have received an automatic reply letting you know about our standard support channels.
Could you please send the file 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 |
Instructions - How to post in this forum |