Redraw slow on complex charts

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Andy
Newbie
Newbie
Posts: 32
Joined: Wed Apr 18, 2007 12:00 am
Location: Germany Oldenburg
Contact:

Redraw slow on complex charts

Post by Andy » Tue Mar 24, 2009 3:57 pm

Hello !

I want some "animation/highlighting" in the chart.
For example click on axis -> axis gets red.

This in easy to program. The problem is, that any propery changing forces a complete redraw. This is for large data charts to slow.

So my next idear was to make the animation not in the chart but
with a control (TShape) over the chart.
But moving a control over the chart forces a redraw of the chart, too.

Why uses the InvalidateRect function.
not the yet draw bitmap but redraws the full vector graphic?

Next idear was to copy the chart after every redraw
with TeeCreateBitmap in an image and "animate" this image.
But this is slow, too. TeeCreateBitmap redraws the chart, too.

So my question is how can force that the chart image is fixed
when I mover some controls over it (InvalidateRect per stored bitmap)
or
How can I copy the current show chart in an bitmap very fast.

Thanks
Andreas

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

Post by Yeray » Wed Mar 25, 2009 9:27 am

Hi Andreas,

If your chart is being repainted more times than you wish, try setting AutoRepaint to false and, when you need to repaint it, set it to true and call Chart1.Refresh.
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

Andy
Newbie
Newbie
Posts: 32
Joined: Wed Apr 18, 2007 12:00 am
Location: Germany Oldenburg
Contact:

Redraw slow on complex charts

Post by Andy » Wed Mar 25, 2009 11:04 am

Hello Yeray !

Yes, I know the AutoRepaint property.
If it is off it avoids a redrawing if any property of the chart has changed.

But it does not avoid the repainting if I move a window or a control over it!

I made an experiment:
I have a TPanel which can I resize over the chart with the mouse
(like the zoomrect)

If the Panel gets larger there is no repaint need and the resizing is fast,
but if it gets smaller the new shown chart area must refreshed and resizing is slow.

So I want a quick InvalidateRect function which does not redraws chart
areas with the slow vector drawing but with simple bitmap copy.

I hope you understand what I mean.

A solution would be if I can get the current bitmap of the chart,
hide the chart and show instead of it its bitmap.

But I find no fast procedure the get the current charts bitmap.
TeeCreateBitmap is slow because it makes afull redraw of the whole
chart in a bitmap.
Chart->Canvas is a 3DCanvas so that I cannot use the common
canvas copy function, etc.

Has anybody an idear, how to do this task?

Bye
Andreas Weichert

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 Mar 31, 2009 9:33 am

Hi Andreas,

Could you please send us a prototipe we can run "as-is" so that we can investigate the issue 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

Andy
Newbie
Newbie
Posts: 32
Joined: Wed Apr 18, 2007 12:00 am
Location: Germany Oldenburg
Contact:

Redraw slow on complex charts

Post by Andy » Wed Apr 01, 2009 9:00 am

Hello Narcís!

I found the reason.

If a cursor tool is active, moving shapes over the chart
forces a full redraw.

I have downloaded the file chartspeedtest.zip to you upload server.
It is a c++ - MDIForm.

I have made my own cursortool with 2 line shapes and all is fast, now

Bye
Andreas

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 Apr 01, 2009 9:02 am

Hi Andreas,

Thanks for the information.

In that case TeeChart Pro VCL would probably need FastCursor property for TCursorTool as TeeChart for .NET has. I'll add this to the wish-list to be included in future 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

Post Reply