Overflow on chart resize

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Thomas
Newbie
Newbie
Posts: 5
Joined: Thu Feb 04, 2016 12:00 am

Overflow on chart resize

Post by Thomas » Wed Jan 11, 2017 9:11 am

Hi support
On chart resize to very small width I get Float overflow error. Note that c++ builder do not mask overflows so in case you allow overflows then TeeChart should mask them. Attached is a demo example, but any chart behave like this.
Attachments
ChartResizeError.zip
(56.24 KiB) Downloaded 1375 times

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Overflow on chart resize

Post by Yeray » Wed Jan 11, 2017 10:35 am

Hello,

Are you running the latest version available, v2016.19?
I can't reproduce this problem with it.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Thomas
Newbie
Newbie
Posts: 5
Joined: Thu Feb 04, 2016 12:00 am

Re: Overflow on chart resize

Post by Thomas » Wed Jan 11, 2017 10:58 am

Yes, I run the latest official version and in C++ builder Berlin 10.1.2. The problem only occur with Win64 target platform.
I have just looked at the stack trace and the error in the example project occurs in DoDefaultLabels, but I have seen in other functions as well for my real project but always related to label position calculation.

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Overflow on chart resize

Post by Yeray » Thu Jan 12, 2017 11:41 am

Hello,

I could reproduce the problem so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1745

This worked wine with v2016.18.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Lykke
Newbie
Newbie
Posts: 4
Joined: Mon Jan 28, 2019 12:00 am

Re: Overflow on chart resize

Post by Lykke » Thu Mar 21, 2019 3:13 pm

It is now 2 years since I reported this and it is still not fixed. Please fix this critical issue a.s.a.p. Why should I continue my subscription if such critical bugs is not even fixed within two years?

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Overflow on chart resize

Post by Yeray » Fri Mar 22, 2019 9:22 am

Hello,

I'm sorry to hear you are so disappointed.

We got to the conclusion that the necessary verifications should be done by the developer to not affect the performance (here).

In the case of a resize, I can only think on avoiding it with the OnResize event. Ie:

Code: Select all

procedure TForm1.ChartResize(Sender: TObject);
begin
  if Chart1.Height<100 then
     Chart1.Height:=100;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Lykke
Newbie
Newbie
Posts: 4
Joined: Mon Jan 28, 2019 12:00 am

Re: Overflow on chart resize

Post by Lykke » Tue Mar 26, 2019 2:38 pm

This is clearly not the correct solution as this means the chart cannot be resized below that size. Also what if the margins change, then the constant 100 should also change. Please look at it again to avoid the overflow in your calculations. Right now I mask overflow exceptions, but clearly that means any overflow problem in the project will not be found (time bomb). So this is not a solution in the long term.

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Overflow on chart resize

Post by Yeray » Mon Apr 01, 2019 9:43 am

Hello,

An alternative would be to modify the MinAxisIncrement property as Whookie said here. Have you tried that?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Lykke
Newbie
Newbie
Posts: 4
Joined: Mon Jan 28, 2019 12:00 am

Re: Overflow on chart resize

Post by Lykke » Mon Apr 08, 2019 12:33 pm

I have tried, but I do not know if I did it correctly. I have now installed binary version and not source code version. I installed just now source code version in parallel without running teerecompile. Then I modified Teengine.pas. Ran Teerecompile without installing packages into the IDE. Compied VCLTee.Teengine.dcu's to binary installation folders. Seems not to make a difference. Anything I miss? Can you make the test on your side?

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Overflow on chart resize

Post by Yeray » Tue Apr 09, 2019 8:38 am

Hello,

To check if a change in the sources is being used I would do this:
- Install TeeChart Pro with sources.
- Do the changes in the main sources (in "Source" folder, not in "VCL" folder).
- Run "TeeRecompile -generateunits:26" from the command prompt (this overwrites "VCL" and "FMX" folders if they exist).
- Add the "Source\VCL" folder to the library path. Remove or comment any reference to a TeeChart binary install.
- Place a breakpoint to the modified lines in the "Source\VCL" version.
- Run the project and see if the modified lines are used.

NOTE: You can modify the units at the "Source\VCL" folder, but running TeeRecompile will overwrite that folder. So, before running TeeRecompile make sure you move the changes to the non prefixed units at the "Source" folder.

When you are happy with the changes in your sources, I would:
- Run TeeRecompile to generate the .dcus.
- Modify the library path to reference the "Compiled" folders (ie "Compiled\Delphi26.win32\Lib") as a binary installation would do.
- Remove or comment the reference to the "Source\VCL" folder in the library path.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Lykke
Newbie
Newbie
Posts: 4
Joined: Mon Jan 28, 2019 12:00 am

Re: Overflow on chart resize

Post by Lykke » Tue Apr 09, 2019 10:19 am

Below seems to work. I think the problem is that FPU uses 80 bit internally wheras SSE only uses 64 bit. For this reason the MinAxisIncrement will have to be higher on Win64 platform (SSE). I have not investigated the lower possible value for MinAxisIncrement, but at least below seems to work. It is a much lower value than used in the other thread. Can you investigate further and include this fix in the next release?

Code: Select all

      MinAxisIncrement :TAxisValue = {$IFDEF TEEVALUESINGLE}
                                     1.40129846432482e-45
                                     {$ELSE}
                                       {$IFDEF WIN64}
                                         1.40129846432482e-45             
                                       {$ELSE}
                                         4.94065645841247e-324  //this IS MinDouble
                                       {$ENDIF}
                                     {$ENDIF}; // Epsilon 0.000000000001;  { <-- "double" for BCB }

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Overflow on chart resize

Post by Yeray » Tue Apr 09, 2019 2:05 pm

Hello,

We've added this proposal to the sources, closing the bug #1745.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply