CalcIncrement

TeeChart for ActiveX, COM and ASP
Post Reply
FP
Newbie
Newbie
Posts: 14
Joined: Mon May 17, 2004 4:00 am

CalcIncrement

Post by FP » Mon Jun 07, 2004 4:05 pm

Hi,

I'm just wondering when the CalcIncrement method is supposed to return reliable results. As far as I've seen values aren't good and steady until when _OnAfterDraw fires. In events that fire before this event CalcIncrement returns diffrent values.

Is there any way to get a reliable measurement for the Labels Increment before the chart is completely redrawn?

I'd like to format axis labels differently depending on Increment.

/ Fredrik

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Jun 08, 2004 7:45 am

Hi Fredrik,

how about using the Environment.Internal repaint method ? (Se the Help for details).

FP
Newbie
Newbie
Posts: 14
Joined: Mon May 17, 2004 4:00 am

Post by FP » Tue Jun 08, 2004 8:07 am

Calling Internalrepaint in the eventhandlers for the chart seems to make it (the chart) crash quite unpredictably.

Even if the chart would not crash, do you have a good method to avoid infinite recursion if you call InternalRepaint from an eventhandler?

Marc
Site Admin
Site Admin
Posts: 1273
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Wed Jun 09, 2004 12:21 pm

Hello,

InternalRepaint called from event handlers could cause repaint recursion ...with the results that you've seen, in general best not to call it from events. InternalRepaint causes an internal paint (as the name suggests) and allows you to 'setup' characteristics and in this case possibly to be able to pre-read dimensions for when you come to the screen paint of the Chart.

If that doesn't give you the result you require then there is little other way to calculate Increment as CalcIncrement needs the paint process complete to be able to effectively return the correct result. Other elements such as string lengths (in pixels) could be calculated by knowing Font info of an element and using TeeChart's canvas methods TextWidth, TextHeight, etc. Most other element positions can be obtained via Axis or Series CalcX... and CalcY... methods. See Tutorial 13 for details.

Regards,
Marc Meumann
Steema Support

Post Reply