EOverflow exception while loading a data to Chart
Posted: Fri Nov 24, 2006 11:44 am
Hello.
I have a problem with loading "zero" values to TeeChart. EOverflow exception raising when data contains only "zero" values. It's raise at line 2695 {TeEngine.pas}
when IRange is very small (like IRange = 4.0403223612e-311), then result of IAxisSize/IRange is very big (more then MaxDouble). As the result is rasing of EOverflow exception.
I think it's can be correct this way:
I have a problem with loading "zero" values to TeeChart. EOverflow exception raising when data contains only "zero" values. It's raise at line 2695 {TeEngine.pas}
Code: Select all
Procedure TChartAxis.InternalCalcRange;
begin
IRange:=IMaximum-IMinimum;
IRangeZero:=IRange=0;
if IRangeZero then IAxisSizeRange:=0
else IAxisSizeRange:=IAxisSize/IRange; {line 2695}
I think it's can be correct this way:
Code: Select all
Procedure TChartAxis.InternalCalcRange;
begin
IRange:=IMaximum-IMinimum;
IRangeZero:=IRange=0;
if IRangeZero then IAxisSizeRange:=0
else
try
IAxisSizeRange:=IAxisSize/IRange;
except
on E: EOverflow do
IAxisSizeRange := MaxDouble;
else
raise
end;