TV52012275 - MinimumRound, MaximumRound in v 8.01

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Miket
Newbie
Newbie
Posts: 23
Joined: Thu Apr 15, 2004 4:00 am
Location: Russia, Moscow
Contact:

TV52012275 - MinimumRound, MaximumRound in v 8.01

Post by Miket » 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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jul 03, 2007 7:05 am

Hi Michael,

Thanks for your suggestion! This may help other users solve this issue while we don't find a definitive solution.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply