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
CalcIncrement
Hi Fredrik,
how about using the Environment.Internal repaint method ? (Se the Help for details).
how about using the Environment.Internal repaint method ? (Se the Help for details).
Pep Jorge
http://support.steema.com
http://support.steema.com
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
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