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