Performance / Buffering chart repaints
Performance / Buffering chart repaints
Is there a method of buffering the chart updates?
We have anything from 50 to 300 traces, each of a few hundred data points. The time taken for the chart to be drawn can be anything from 300ms on a fast machine to 2000ms on a slower machine. This is fine for the first time but the whole chart seems to be always redrawn even for forms being moved over the top of the chart.
I would have thought that the whole chart only needs to be redrawn when the series data is manipulated, the graph zoomed or panned etc. For a simple redraw can it use a cached canvas / image?
I've used all of the optimisation tricks I could find in the forum.
The chart uses fastlines and CoordTrackLines.
Any further tips?
We have anything from 50 to 300 traces, each of a few hundred data points. The time taken for the chart to be drawn can be anything from 300ms on a fast machine to 2000ms on a slower machine. This is fine for the first time but the whole chart seems to be always redrawn even for forms being moved over the top of the chart.
I would have thought that the whole chart only needs to be redrawn when the series data is manipulated, the graph zoomed or panned etc. For a simple redraw can it use a cached canvas / image?
I've used all of the optimisation tricks I could find in the forum.
The chart uses fastlines and CoordTrackLines.
Any further tips?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Loz,
I'd suggest you to have a look at the code example I posted on this thread. Using autorepaint property may help you solving your problems.
I'd suggest you to have a look at the code example I posted on this thread. Using autorepaint property may help you solving your problems.
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 |
Thanks for the info. Unfortunately I'm already doing that.
I'm fairly happy with the first time the graph is draw with all of the traces.
The problem comes when the canvas needs to be repainted. It doesn't seem to just use a cached image, it actually redraws the series. I tried dragging windows over the top of the 'feature demo' and I can see the same effect (albeit it's fast with that chart as there are only two traces).
If I reduce the number of visible traces from 300 down to a couple, it's really fast. I'd have thought that if it used a cached copy of the canvas when there's been no change to the zoom / panning / data then it should be just as fast.
I'm fairly happy with the first time the graph is draw with all of the traces.
The problem comes when the canvas needs to be repainted. It doesn't seem to just use a cached image, it actually redraws the series. I tried dragging windows over the top of the 'feature demo' and I can see the same effect (albeit it's fast with that chart as there are only two traces).
If I reduce the number of visible traces from 300 down to a couple, it's really fast. I'd have thought that if it used a cached copy of the canvas when there's been no change to the zoom / panning / data then it should be just as fast.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Loz,
Have you tried setting AutoRepaint back to false after series have been refreshed and just set this property to true when you want the series being refreshed? That way the chart should only be repainted when data has been added to the series.
Have you tried setting AutoRepaint back to false after series have been refreshed and just set this property to true when you want the series being refreshed? That way the chart should only be repainted when data has been added to the series.
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 |
Yes, I've tried setting the AutoRepaint to false afterwards too.
This doesn't make any difference to the timing.
1. If I have AutoRepaint enabled and reduce the number of visible traces, it gets faster. 2000ms down to 30ms for 1 visible trace.
2. If I have AutoRepaint disabled and reduce the number of visible traces, it's faster as in (1) but I only see a small area of the screen being redrawn.
It's almost as if the graph is redrawn no matter what the setting and it only affects how the visible canvas is updated.
I ran DevPartner Studio and it confirms the internal Draw commands are being called regardless of AutoRepaint. I think it's this internal re-drawing that's causing the problem. I wouldn't have thought it should be doing that if the AutoRepaint is false or unless data or the view has changed?
We really like version 3 and if we can figure out a way of improving the performance it'd be spot on.
This doesn't make any difference to the timing.
1. If I have AutoRepaint enabled and reduce the number of visible traces, it gets faster. 2000ms down to 30ms for 1 visible trace.
2. If I have AutoRepaint disabled and reduce the number of visible traces, it's faster as in (1) but I only see a small area of the screen being redrawn.
It's almost as if the graph is redrawn no matter what the setting and it only affects how the visible canvas is updated.
I ran DevPartner Studio and it confirms the internal Draw commands are being called regardless of AutoRepaint. I think it's this internal re-drawing that's causing the problem. I wouldn't have thought it should be doing that if the AutoRepaint is false or unless data or the view has changed?
We really like version 3 and if we can figure out a way of improving the performance it'd be spot on.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Loz,
Yes, this is a known problem and is common to all controls (System.Windows.Forms.Control) that's where TeeChart's base class inherits from. Even the control is set to DoubleBuffer every time the form containing a control is opened or some other window is dragged over it, the control is repainted.
We are investigating on implementing a manual DoubleBuffer feature to avoid that behaviour.
Yes, this is a known problem and is common to all controls (System.Windows.Forms.Control) that's where TeeChart's base class inherits from. Even the control is set to DoubleBuffer every time the form containing a control is opened or some other window is dragged over it, the control is repainted.
We are investigating on implementing a manual DoubleBuffer feature to avoid that behaviour.
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 Loz,
Thanks for your offering.
For now, the only solution we are aware of is implementing manual DoubleBuffer.
I'd recommend you to be aware at this forum for new release announcements and its release notes for what's being implemented/fixed on them.
Thanks for your offering.
For now, the only solution we are aware of is implementing manual DoubleBuffer.
I'd recommend you to be aware at this forum for new release announcements and its release notes for what's being implemented/fixed on them.
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 |
-
- Newbie
- Posts: 38
- Joined: Thu Feb 01, 2007 12:00 am
Is there anything else at this point that can be done to suppress the repaint of the TeeChart graph when the window containing it is resized or moved or anything like that?
I also tried setting the AutoRepaint to false but any time I resize my MDI Child window containing the TeeChart control, the redraw gets called while I am resizing.
Our solution was to display a bitmap image of the chart instead of the TeeChart control itself. This way, we control when that image gets refreshed.
This sounded like a good idea until we start to try to add other Steema tools/controls into the use of our chart (like axis arrows, etc). Now we are having a problem because we are not operating directly with the TeeChart control but instead we are operating against a bitmap image that reproduces what the TeeChart control would look like.
Any improvements on this repaint process would be greatly appreciated. I understand your obstacle due to the base class limitations but if there is anything that can help with this sort of thing, it would be very useful.
Thanks.
Aaron
I also tried setting the AutoRepaint to false but any time I resize my MDI Child window containing the TeeChart control, the redraw gets called while I am resizing.
Our solution was to display a bitmap image of the chart instead of the TeeChart control itself. This way, we control when that image gets refreshed.
This sounded like a good idea until we start to try to add other Steema tools/controls into the use of our chart (like axis arrows, etc). Now we are having a problem because we are not operating directly with the TeeChart control but instead we are operating against a bitmap image that reproduces what the TeeChart control would look like.
Any improvements on this repaint process would be greatly appreciated. I understand your obstacle due to the base class limitations but if there is anything that can help with this sort of thing, it would be very useful.
Thanks.
Aaron
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Aaron,
I'm afraid there's anything else that can be done here for now. As I posted before, we will try implementing manual DoubleBuffer support to solve this problem.
I'm afraid there's anything else that can be done here for now. As I posted before, we will try implementing manual DoubleBuffer support to solve this problem.
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 |