Page 1 of 1
Overflow on chart resize
Posted: Wed Jan 11, 2017 9:11 am
by 16477605
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.
Re: Overflow on chart resize
Posted: Wed Jan 11, 2017 10:35 am
by yeray
Hello,
Are you running the latest version available, v2016.19?
I can't reproduce this problem with it.
Re: Overflow on chart resize
Posted: Wed Jan 11, 2017 10:58 am
by 16477605
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.
Re: Overflow on chart resize
Posted: Thu Jan 12, 2017 11:41 am
by yeray
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.
Re: Overflow on chart resize
Posted: Thu Mar 21, 2019 3:13 pm
by 16585494
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?
Re: Overflow on chart resize
Posted: Fri Mar 22, 2019 9:22 am
by yeray
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;
Re: Overflow on chart resize
Posted: Tue Mar 26, 2019 2:38 pm
by 16585494
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.
Re: Overflow on chart resize
Posted: Mon Apr 01, 2019 9:43 am
by yeray
Hello,
An alternative would be to modify the MinAxisIncrement property as Whookie said
here. Have you tried that?
Re: Overflow on chart resize
Posted: Mon Apr 08, 2019 12:33 pm
by 16585494
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?
Re: Overflow on chart resize
Posted: Tue Apr 09, 2019 8:38 am
by yeray
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.
Re: Overflow on chart resize
Posted: Tue Apr 09, 2019 10:19 am
by 16585494
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 }
Re: Overflow on chart resize
Posted: Tue Apr 09, 2019 2:05 pm
by yeray
Hello,
We've added this proposal to the sources, closing the bug
#1745.