mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 22:58:50 +02:00
TAChart: Fix crash of fitdemo due to drawing of confidence/prediction limits for invalid fit results. Issue #37354.
git-svn-id: trunk@63603 -
This commit is contained in:
parent
ee626c0196
commit
1357d17c34
@ -3,7 +3,7 @@ object frmMain: TfrmMain
|
||||
Height = 543
|
||||
Top = 133
|
||||
Width = 1026
|
||||
Caption = 'frmMain'
|
||||
Caption = 'Fit demo'
|
||||
ClientHeight = 543
|
||||
ClientWidth = 1026
|
||||
OnCreate = FormCreate
|
||||
|
@ -208,8 +208,18 @@ procedure TfrmMain.cbFitEquationSelect(Sender: TObject);
|
||||
var
|
||||
eq: TFitEquation;
|
||||
begin
|
||||
// Prevent drawing of interval series while fit result is not yet valid
|
||||
// They will be re-activated in FitSeries.OnFitComplete
|
||||
{$IF FPC_FullVersion >= 30004}
|
||||
UpperConfIntervalSeries.Active := false;
|
||||
LowerConfIntervalSeries.Active := false;
|
||||
{$IFEND}
|
||||
|
||||
// Set new kind of fit equation
|
||||
eq := TFitEquation(cbFitEquation.ItemIndex);
|
||||
FitSeries.FitEquation := eq;
|
||||
|
||||
// Adapt GUI according to new fit equation.
|
||||
edFitOrder.Enabled := (eq = fePolynomial);
|
||||
lblFitOrder.Enabled := edFitOrder.Enabled;
|
||||
|
||||
@ -540,6 +550,11 @@ begin
|
||||
LowerConfIntervalSeries.OnCalculate := @FitSeries.GetLowerConfidenceInterval;
|
||||
UpperPredIntervalSeries.OnCalculate := @FitSeries.GetUpperPredictionInterval;
|
||||
LowerPredIntervalSeries.OnCalculate := @FitSeries.GetLowerPredictionInterval;
|
||||
|
||||
UpperConfIntervalSeries.Active := cbShowConfidenceIntervals.Checked;
|
||||
LowerConfIntervalSeries.Active := cbShowConfidenceIntervals.Checked;
|
||||
UpperPredIntervalSeries.Active := cbShowPredictionIntervals.Checked;
|
||||
LowerPredIntervalSeries.Active := cbShowPredictionIntervals.Checked;
|
||||
{$IFEND}
|
||||
|
||||
Add('');
|
||||
|
Loading…
Reference in New Issue
Block a user