TV52012275 - MinimumRound, MaximumRound in v 8.01
Posted: Mon Jul 02, 2007 3:25 pm
Hi Narcis,
As a temporary fix to the issue (defect) TV52012275 I modified source code of TeEngine.pas
More specifically:
Procedure TChartAxis.CalcRoundScales; lines with Ceil and Floor functions
// ========= Miket correction ================
IMaximum:=tmpInc*Ceil(IMaximum/tmpInc-1.e-10);
// ========= end of Miket correction ================
end
else
tmpInc:=0;
<...snip...>
if tmpInc<>0 then
// ========= Miket correction ================
IMinimum:=tmpInc*Floor(IMinimum/tmpInc+1.e-10);
// ========= end of Miket correction ================
The purpose of these modifications is obvious. In some situations the procedure CalcRoundScales is called several times, thus applying some extra undesirable rounding operations. My fix will prevent further modifications io IMInimum and IMaximum if CalcRoundScales was already called. This is quick and dirty fix, much better approach would be to avoid repetitive calls of CalcRoundScales at all.
It is also not a complete solution to the problem. There are some charts demonstrating undesirable repositioning/rescaling even with my fix.
Hope that my note will help you to improve TeeChart even more!
Sincerely,
Michael
As a temporary fix to the issue (defect) TV52012275 I modified source code of TeEngine.pas
More specifically:
Procedure TChartAxis.CalcRoundScales; lines with Ceil and Floor functions
// ========= Miket correction ================
IMaximum:=tmpInc*Ceil(IMaximum/tmpInc-1.e-10);
// ========= end of Miket correction ================
end
else
tmpInc:=0;
<...snip...>
if tmpInc<>0 then
// ========= Miket correction ================
IMinimum:=tmpInc*Floor(IMinimum/tmpInc+1.e-10);
// ========= end of Miket correction ================
The purpose of these modifications is obvious. In some situations the procedure CalcRoundScales is called several times, thus applying some extra undesirable rounding operations. My fix will prevent further modifications io IMInimum and IMaximum if CalcRoundScales was already called. This is quick and dirty fix, much better approach would be to avoid repetitive calls of CalcRoundScales at all.
It is also not a complete solution to the problem. There are some charts demonstrating undesirable repositioning/rescaling even with my fix.
Hope that my note will help you to improve TeeChart even more!
Sincerely,
Michael