Page 1 of 1

Charts don't draw when application receives focus

Posted: Fri Nov 26, 2010 1:27 pm
by 16457834
Hi. I just updated from TeeChart v8.04 to TeeChart 2010 in Delphi 2007, and a new problem has appeared. I have an application that stacks a number of synchronised TCharts. When the application first builds the charts all is well. (first image in attachment). If I then switch to another application (second image), and then back to the first application, without doing anything else other than switch applicaitons, the last chart in the stack doesn't fully redraw (third image). If I rebuild the stack the last chart disappears altogether (fourth image, not allowed). There is a transparent space where the chart should be. Tis happens both within the IDE and with the freestanding compiled executable. Any ideas?

Thanks very much.

Re: Charts don't draw when application receives focus

Posted: Fri Nov 26, 2010 3:51 pm
by yeray
Hi,

Are you using the latest version available in the client area?
Note that this seems very similar to what was discussed here.
toreba wrote:Tis happens both within the IDE and with the freestanding compiled executable
Could you please tell us what exact example in the features demo should we open and what exact steps should we follow to reproduce this problem?
Thanks in advance.

Re: Charts don't draw when application receives focus

Posted: Fri Nov 26, 2010 9:54 pm
by 16457834
I think I'm using the latest version. A TChart announces itself as 'TeeChart Pro v2010.01.11004 Win32'. That's the latest isn't it? We only bought it last week.

I agree that the problem does sound a little like the one you referred me to, although that I am not using TeeCommander or copying the canvas to the clipboard. My problem occurs only when I try to parent TLabels on the TChart to provide extra labelling. I do this with the lines like this:

lblLabel.Parent:=chtChart;
lblLabel.Left:=(lblLabel.Parent as TChart).ChartRect.Right - lblLabel.Width;
lblLabel.Top:=(lblLabel.Parent as TChart).Legend.RectLegend.Top;
lblLabel.Refresh;

In all previous versions of TeeChart since we first started using it over ten years ago, this has worked fine, but now something has changed in TeeChart v2010. It's as though an exception is handled silently, preventing the canvas being redrawn.

If I don't try to add the TLabel, the TChart behaves as beautifully as ever.

Hope that helps...

Re: Charts don't draw when application receives focus

Posted: Mon Nov 29, 2010 7:33 am
by 9244525
TChart 2010, Labels and Repainting:
sounds like a problem I have (had) too...

http://www.teechart.net/support/viewtop ... =3&t=11873

Re: Charts don't draw when application receives focus

Posted: Mon Nov 29, 2010 10:32 am
by yeray
Hi toreba,

As ChartIt says, if the chart repainting problem is caused by a label with the chart as parent, it could be the same problem we've recently identified here (TV52015292). Could you please confirm it?
If that's the problem, while the problem isn't resolved, I'd suggest you the same: use Annotations or Rectangle tool or force the chart repaint when needed.

Re: Charts don't draw when application receives focus

Posted: Tue Nov 30, 2010 1:29 pm
by 16457834
Yeray,

Yes, I think it is the same problem. Similar to ChartIt's description, my chart appears if I click on it, but disappears on releasing the click. When it appears, one of the two parented TLabels is missing.

I think I can use your suggestions to find another way of presenting the labelling information. So thanks to you and ChartIt for the advice.