mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 12:29:30 +02:00
Merged revision(s) 62069-62070 #40d59fec0b-#40d59fec0b, 62073 #6d317e22dc from trunk:
TAChart: Fix chart distance tools crashing when series contains a NaN value. ........ TAChart: Replace r62069 #40d59fec0b by better solution. ........ TAChart: Fix divide-by-zero error in TFitSeries. ........ git-svn-id: branches/fixes_2_0@62084 -
This commit is contained in:
parent
8e223c396b
commit
fbe9203283
@ -1742,8 +1742,12 @@ var
|
||||
begin
|
||||
Unused(APointIdx);
|
||||
Unused(AXIdx, AYIdx);
|
||||
pt := ParentChart.GraphToImage(AGraphPt);
|
||||
Result := AParams.FDistFunc(AParams.FPoint, pt);
|
||||
if IsNaN(AGraphPt) then
|
||||
exit(MaxInt)
|
||||
else begin
|
||||
pt := ParentChart.GraphToImage(AGraphPt);
|
||||
Result := AParams.FDistFunc(AParams.FPoint, pt);
|
||||
end;
|
||||
end;
|
||||
|
||||
// AIndex refers to the index into YList here.
|
||||
|
@ -332,7 +332,10 @@ begin
|
||||
ycalc := CalcBestFitValues(x, y, n, m, FitParams);
|
||||
CalcSumOfSquares(y, dy, ycalc, Result.SSE, Result.SSR);
|
||||
SetLength(ycalc, 0);
|
||||
chi2 := Result.SSE / (n - mfit);
|
||||
if n > mfit then
|
||||
chi2 := Result.SSE / (n - mfit)
|
||||
else
|
||||
chi2 := NaN;
|
||||
|
||||
// Calculate inverse of alpha. This is (almost) the variance-covariance matrix
|
||||
invgen(mfit, mfit, alpha[0], term);
|
||||
|
Loading…
Reference in New Issue
Block a user