Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 1745

Summary: Floating point overflow when resizing a chart to the minimum in 64-bits
Product: VCL TeeChart Reporter: yeray alonso <yeray>
Component: AxisAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: normal CC: gustav.kaiser
Priority: ---    
Version: 20.170306   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
URL: http://www.teechart.net/support/viewtopic.php?f=3&t=16390
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description yeray alonso 2017-01-12 06:40:48 EST
Resizing the window in the chart below, there is a point where labels calculation throws a "Floating point overflow".

Only in 64-bits with v2016.19.
Works fine in 32-bits.
Worked fine in 64-bits with v2016.18.

uses VCLTee.Chart, VCLTee.Series;

var Chart1: TChart;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1:=TChart.Create(Self);
  Chart1.Parent:=Self;
  Chart1.Align:=alClient;

  Chart1.View3D:=False;
  Chart1.Legend.Visible:=False;

  Chart1.AddSeries(TFastLineSeries).FillSampleValues(1000);
end;
Comment 1 yeray alonso 2017-04-06 02:42:18 EDT
Another customer suggests to fix it adding this at the end of the function TChartAxis.CalcIncrement:

  if IsZero(result) then
    Result := 0.00000001;

http://www.teechart.net/support/viewtopic.php?f=3&t=16512&p=73455#p73414
Comment 2 yeray alonso 2019-04-09 09:20:21 EDT
Other fix proposals from customers consist on modifying the MinAxisIncrement for WIN64.

- Here using 0.00000001:

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

- Here using 1.40129846432482e-45:

      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 }