Chart cursor consumes up to 100 % CPU

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
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 16, 2005 2:35 pm

Hi Natalia,

Code: Select all

The real problem is that when you turn cursor on and have FollowMouse true, tChart calls OnCursorChange and MouseMove events even when we DO NOT MOVE THE MOUSE over the chart! Just move the mouse to the chart area and leve it there - you'll still constantly get above events. 
You're right, I've been able to reproduce this bug here and it is already fixed for the next release.

Meanwhile you will need to use a workaround as the one Elric purposed.
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

Natalia
Newbie
Newbie
Posts: 5
Joined: Tue Apr 08, 2003 4:00 am
Location: Santa Clara, CA, USA

Post by Natalia » Wed Feb 16, 2005 7:39 pm

Thanks for your reply.

When is the next release?

Eric, thanks for the suggested workaround. I am sorry, however, I do not understand how it is supposed to solve my problem. FollowMouse becomes false as soon as stop moving and get the mouse from the cursor. And then to begin again, I need to find the cursor and start dragging it for FollowMouse to become true. So in fact I am getting the behaviour very similar to the one with FollowMouse= false all the time.

Not to mention the fact that I am loosing the cursor every time I do zoom or scroll, and with FollowMouse=false I will have to keep track of it all the time..

Elric
Newbie
Newbie
Posts: 21
Joined: Fri Nov 15, 2002 12:00 am

Post by Elric » Thu Feb 17, 2005 3:04 pm

Hello Natalia

I dont know exactly, where your problem is (what means "I need to find the cursor", because the cursor remains on the same position. FollowMouse=False only when you dont move). But I think mostly my bad English is to blame for.
But you're right: my workaraound solves only the problem, that CPU usage is high, when you DONT move the mouse. When you must move the mouse on the chart many times (or all the time) the workaraound is useless.
Then the only thing you can do is: program yourself the function, that makes the CursorTool usefull for you, and hope this works good until the next release comes.

Greetings
Elric

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 17, 2005 3:23 pm

Hi Natalia,
When is the next release?
TeeChart for .NET v2 will be released before the end of this quarter.
Eric, thanks for the suggested workaround. I am sorry, however, I do not understand how it is supposed to solve my problem. FollowMouse becomes false as soon as stop moving and get the mouse from the cursor. And then to begin again, I need to find the cursor and start dragging it for FollowMouse to become true. So in fact I am getting the behaviour very similar to the one with FollowMouse= false all the time.

Not to mention the fact that I am loosing the cursor every time I do zoom or scroll, and with FollowMouse=false I will have to keep track of it all the time..
Having 2 cursor tools with FollowMouse=true and using the code below in the MouseMove event, it is fired constantly but not the CursorChange and the cursor behaves as if nothing happened.

Code: Select all

			if ((e.X != x_old) || (e.Y != y_old)) 
			{
				cursorTool1.Active = true;
				cursorTool2.Active = false;
			}
 
			else	   
			{
				cursorTool2.Active = true;
				cursorTool2.XValue = cursorTool1.XValue;
				cursorTool2.YValue = cursorTool1.YValue;
				cursorTool1.Active = false;
			}

			x_old = e.X;
			y_old = e.Y; 
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

Dmitry
Newbie
Newbie
Posts: 1
Joined: Mon Apr 03, 2006 12:00 am

Post by Dmitry » Wed Apr 05, 2006 2:23 pm

narcis wrote: You're right, I've been able to reproduce this bug here and it is already fixed for the next release.
A year has passed but I see bug is still here (version 2.0.2179.21171) :( Is there any hope for correcting it?

As far as I understand the model of the problem:
0. Mouse moving causes tChart.OnMouseMove
1. tChart.OnMouseMove calls broadcasting of MouseEventKinds.Move to tools and series.
2. CursorTool.OnMouseEvent calls Invalidate what calls tChart.Invalidate.
3. tChart.Invalidate causes tChart.OnMoiseMove (look at step 1).

I suspect it can causes a memory leak too...

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 Apr 10, 2006 9:19 am

Hi Dmitry,

It had already been fixed but broken again in the latest versions. Anyway, we have fixed that for the next debug build and maintenance releases.
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

Natalia
Newbie
Newbie
Posts: 7
Joined: Tue Apr 08, 2003 4:00 am

Problem with cursot CPU usage still there

Post by Natalia » Mon Jun 25, 2007 10:42 pm

Hi,
We are using Build 1.1.2531.28391 and the problem is still there! Leaving a mouse on the chart takes 100% CPU.

Any plans to fix it?

Natalia

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 Jun 26, 2007 7:50 am

Hi Natalia,

Is mostly unlikely that this will be fixed in v1. The issue was fixed in v2 and current TeeChart for .NET version is v3, which was released last month.
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

Natalia
Newbie
Newbie
Posts: 7
Joined: Tue Apr 08, 2003 4:00 am

Tried v2

Post by Natalia » Wed Jun 27, 2007 1:05 am

Hi,
first, we don't really need the next versions - do we have to buy them full price just because the bugs keep coming back?

Second, I tried v 2 Evaluation version.
Without changing any code it compiles - this is good:)
But it does not run.

Trying to set Series property for the CursorTool, I get this. What has changed?
m_cursor.Series = series;

The series are of class Steema.TeeChart.Styles.Series
I have an impression it works with Steema.TeeChart.Styles.Line - but it used to work with both.

Exception: Invalid parameter used.

Occured in: Void CheckErrorStatus(Int32)

Stack info:
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)

at System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2)

at Steema.TeeChart.Drawing.Graphics3DGdiPlus.VerticalLine(Int32 x, Int32 top, Int32 bottom)

at Steema.TeeChart.Tools.CursorTool.DrawVertical(Rectangle r, Int32 X)

at Steema.TeeChart.Tools.CursorTool.DrawCursorLines(Boolean Draw3D, Rectangle R, Int32 X, Int32 Y)

at Steema.TeeChart.Tools.CursorTool.RedrawCursor()

at Steema.TeeChart.Tools.CursorTool.SetSeries(Series value)

at Steema.TeeChart.Tools.ToolSeries.set_Series(Series value)

at ChartControl.ChartControl.set_ShowCursor(Boolean value) in c:\views\iboxsr1394\ibox\netsrc\datawindow\chartcontrol\chartcontrol.cs:line 775

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 Jun 27, 2007 7:04 am

Hi Natalia,
first, we don't really need the next versions - do we have to buy them full price just because the bugs keep coming back?
You don't need to pay full price for the current version (v3), there's a special upgrade price for v1 license holders as you can see here. And as I told you, the bug you reported was fixed in v2 and v3.
Second, I tried v 2 Evaluation version.
Please notice that current version is TeeChart for .NET v3.
Without changing any code it compiles - this is good:)
But it does not run.

Trying to set Series property for the CursorTool, I get this. What has changed?
m_cursor.Series = series;

The series are of class Steema.TeeChart.Styles.Series
I have an impression it works with Steema.TeeChart.Styles.Line - but it used to work with both.
Could you please send us a simple example project we can run "as-is" to reproduce the problem here? You can post your files at news://www.steema.net/steema.public.attachments newsgroup or our upload page.
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