Vertical Line for cursor

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Vertical Line for cursor

Post by GoToXY » Thu Mar 11, 2010 6:52 pm

Hi, i would like to know what would be the best optimized solution to implement a vertical bar as a cursor. I'm trying to do a data logger analyser and having an vertical bar that is draw at the x,y of my mouse. With the OnAfterDraw event, thing go well until i get a lot of data. We do logs value every 1min and sometime people want to to check a full month or more, So doing a onMouseMove with Chart.Invalidate in is very very too much hard on my CPU and my vertical bar start to lag a lot.

What came first in my mind was to do some "double buffer":
1. Get a copy of the paint result in OnAfterDraw.
2. OnMouseMove -> Draw the copy over TChart and then, draw my vertical bar.

I havent tried it, but i was wondering, since there is a lots of tools already developped, if there was a better way to do that.

Thanks again.

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

Re: Vertical Line for cursor

Post by Narcís » Fri Mar 12, 2010 8:50 am

Hi GotoXY,

Why don't you try using a cursor tool set to vertical and optionally set FastCursor = true. You could also set cursor's pen settings. Another alternative would be using a ColorBand tool.

Hope this helps!
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

GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Re: Vertical Line for cursor

Post by GoToXY » Tue Mar 16, 2010 7:26 pm

Hi Narcis, i did try the Option 1 : Using CursorTool
Problem #1, The line is not redraw often, so if i move my mouse fast, the bar will completely disapear.
Problem #2, I presume FastCursor should solve the Problem #1, but it seems that i can't find the property either in TeeChart or TCursorTool.

Im using D2010 and TeeChart 8.06Pro

Thanks again

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Vertical Line for cursor

Post by Yeray » Thu Mar 18, 2010 3:43 pm

Hi GoToXY,

Excuse us, the FastCursor property is only available in TeeChart for NET. In VCL it should be the same by default.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Re: Vertical Line for cursor

Post by GoToXY » Thu Mar 18, 2010 3:47 pm

Seems ill be force to use my technic "double buffer" over your cursor because it dont refresh fast enough and dont look really professionnal that way. Maybe later, you will have a better Graphic handling for the cursor so it will refresh faster.

You can see what i'm talking about in this example.
Attachments
CursorTools.rar
CursorTool vs DoubleBuffer
(9.58 KiB) Downloaded 737 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Vertical Line for cursor

Post by Yeray » Fri Mar 19, 2010 12:05 pm

Hi GoToXY,

I'm afraid I can't see any problem with the cursor tool in your application. This made me think that it could be due to a difference between your and my machine but the task manager here says that this testing application is consuming only 6MB RAM and 0~1% CPU (even moving the cursor as fast as I can).

In the other hand, ok, your lines look more professional (three vertical lines and a circle following the mouse vs a simple vertical line), but it flickers a little bit when moving while I can't see the same with our cursor tool.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Re: Vertical Line for cursor

Post by GoToXY » Fri Mar 19, 2010 5:06 pm

That is very intersting! Because on my machine (Quad Core 2.6) my cursor doesnt flick but yours do and on your machine its the opposite. Ill do some other test over slower machine and let you know how its doing because handling the cursor the way i do... i dont really like it.

And about the professional side, it wasnt about the design but the flickering i was getting from the CursorTool in TeeChart. Only a vertical line would be just fine if it wasnt flickering.

Thanks again Yeray

GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Re: Vertical Line for cursor

Post by GoToXY » Fri Mar 19, 2010 5:11 pm

I did other test and it seems to be happening only in Windows 7. Can you guys check out why ? So i could use your cursor tool.

Thanks a lot

GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Re: Vertical Line for cursor

Post by GoToXY » Wed Mar 24, 2010 12:55 pm

bump

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Vertical Line for cursor

Post by Yeray » Wed Mar 24, 2010 2:19 pm

Hi GoToXY,

Please, be patient, we haven't forgotten you. If you are looking for priority support you you may be interested in knowing of our Pro-Support service:
http://www.steema.com/licensing/support
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Re: Vertical Line for cursor

Post by GoToXY » Wed Mar 24, 2010 2:41 pm

I im very sorry, i was used to the 1 day reply from ur support. I wont do any other bump next time and be patient ;)

Thanks again

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Vertical Line for cursor

Post by Yeray » Fri Mar 26, 2010 10:01 am

Hi GoToXY,

We've investigated this but couldn't find the difference between both systems that could affect this behaviour.
What we've seen is that with the latest drivers available (in our case NVIDIA v197.13) the difference between using Cursor Tool and your lines isn't very significant. The Cursor Tool still seems to work better in XP while your tool seems a little bit better for Win7. But note that the difference is almost inappreciable, even multiplying x10 the number of points.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

GoToXY
Newbie
Newbie
Posts: 81
Joined: Thu Apr 03, 2008 12:00 am

Re: Vertical Line for cursor

Post by GoToXY » Thu Apr 01, 2010 7:25 pm

I have tested it over many video card (ATI,nVidia, onboard Intel) in Win7, i always got flickering with the CursorTool and even when Zooming (the rectangle of the zoom area is flickering a lot too). Can you add this to the wish list please.

Thanks a lot.

BTW: did you guys planned a new version with D2D ? So we could have cool animation in TeeChart ?.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Vertical Line for cursor

Post by Yeray » Tue Apr 06, 2010 11:47 am

Hi GoToXY,
GoToXY wrote:I have tested it over many video card (ATI,nVidia, onboard Intel) in Win7, i always got flickering with the CursorTool and even when Zooming (the rectangle of the zoom area is flickering a lot too). Can you add this to the wish list please.
Of course, done (TV52014780).
GoToXY wrote:BTW: did you guys planned a new version with D2D ? So we could have cool animation in TeeChart ?.
We've made some tests with D2D but it's too soon to announce even if it is going to be feasible or not.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply