Page 1 of 1

Invalidating an area in TChart for .NET

Posted: Wed Feb 21, 2007 11:23 pm
by 9791253
Is there a way that I can redraw only a small area of the TChart in the .NET version 2. If I call TChart.Invalidate(New Rectangle(x1, y1, width, height)), it seems like it redraws the entire chart instead of just the small piece that I have invalidated. Is that correct?

Is there any way that I can get it to redraw just the portion that I need refreshed?

Thanks,
TMac

Posted: Thu Feb 22, 2007 9:29 am
by narcis
Hi TMac,

Invalidate is a .NET Framework's method. Calling it with TeeChart involves several calculations that end with the chart being fully repainted.

For now, a chart region can not be repainted. However, if you let us know what are you exactly trying to achieve we may be able to suggest you an alternative solution.

Posted: Thu Feb 22, 2007 12:44 pm
by 9791253
I am using a TChart for RealTime Financial charting. It updates the latest point on the Chart constantly.

When using the built-in Zoom and Cursor controls they don't work well. The speed is great, but I'm having a lot of trouble with the ReversibleLine and ReversibleRectangles that they use.

Every time the Chart refreshes from an update to the data, the line or rectangle disappears or else it leaves an artifact of the last position on the chart.

I've read the other posts on the site about this problem, and they seem to think it is just a problem in using ReversibleLine and ReversibleRectangle. I tried making my own Cursor and Zoom using Reversibles, and made sure it erased itself before the chart updated, and then redrew itself after the update, but this didn't work either. I can't find a way to make Reversibles work...

So, my only other option is to draw the Cursor and Zoom with GDI+. This works, but it is a lot slower, if the Chart were to only repaint the areas where the Cursor or Zoom box touch, rather than repainting the whole chart every time I move my mouse, it would be a lot faster.

Let me know if you have any suggestions...

Thanks for the help,
TMac

Posted: Fri Feb 23, 2007 11:52 am
by narcis
Hi TMac,

You could try using FastCursor property implemented in last TeeChart for .NET v2 maintenance release available at the client area as discussed in this thread. Here you'll find latest version release notes.