Page 1 of 1

Redraw slow on complex charts

Posted: Tue Mar 24, 2009 3:57 pm
by 9244864
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

Posted: Wed Mar 25, 2009 9:27 am
by yeray
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.

Redraw slow on complex charts

Posted: Wed Mar 25, 2009 11:04 am
by 9244864
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

Posted: Tue Mar 31, 2009 9:33 am
by narcis
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.

Redraw slow on complex charts

Posted: Wed Apr 01, 2009 9:00 am
by 9244864
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

Posted: Wed Apr 01, 2009 9:02 am
by narcis
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.