Page 1 of 1

Defect TV52012275 in 8.02 - fix proposal

Posted: Thu Nov 22, 2007 9:46 am
by 9337075
First of all, I need to confirm that the defect TV52012275 still exists in the version 8.02. This is connected with MinimumRound and MaximumRound properties and the way how Axis rectange is calculated (see CalcRoundScales function). You may be interested to read my posts in the private beta test group and my post dated Jul 02, 2007 in this forum.

Today I found rather simple solution to resolve this issue without modifying Steema code. It may be useful for many customers of TeeChart.

In order to solve weird rescaling problem with MinimumRound and MaximumRound override DoOnBeforeDrawChart in your inherited class (or use OnBeforeFrawChart event handler):

Code: Select all

procedure TMyChart.DoOnBeforeDrawChart;
  var
    i: Integer;
begin
  inherited;
  for i:=0 to Pred(Axes.Count) do
    Axes[i].IAxisSize := 0;
end;


The idea behind this code is simple. With zero IAxisSize function CalcRoundScales will not recalculate IMinimum and IMaximum values twice in repeated paint events, thus scaling will be consistent. It is especially important with charts with alClient alignment, when any resize of parent form causes repaint of the chart.

Regards,
Michael

Posted: Thu Nov 22, 2007 10:39 am
by narcis
Hi Michael,

Thanks for the information. As you said, this may be helpful to other TeeChart users even it's a workaround for certain circumstances.

TV52012275 is still present in v8.02.