TAChart: Remove DataSeries from FitDemo (FitSeries can display data points by itself now).

git-svn-id: trunk@54236 -
This commit is contained in:
wp 2017-02-21 19:09:15 +00:00
parent 0e70e5588a
commit c4bbb8fbea
3 changed files with 19 additions and 34 deletions

View File

@ -2,13 +2,13 @@ object frmMain: TfrmMain
Left = 249
Height = 503
Top = 242
Width = 800
Width = 839
Caption = 'frmMain'
ClientHeight = 503
ClientWidth = 800
ClientWidth = 839
OnCreate = FormCreate
ShowHint = True
LCLVersion = '1.5'
LCLVersion = '1.7'
object pnlParams: TPanel
Left = 8
Height = 487
@ -89,7 +89,7 @@ object frmMain: TfrmMain
Left = 14
Height = 15
Top = 12
Width = 70
Width = 69
Caption = 'Test function'
ParentColor = False
end
@ -274,18 +274,18 @@ object frmMain: TfrmMain
Left = 392
Height = 487
Top = 8
Width = 400
Width = 439
Align = alClient
BorderSpacing.Around = 8
BevelOuter = bvNone
ClientHeight = 487
ClientWidth = 400
ClientWidth = 439
TabOrder = 1
object Chart: TChart
Left = 0
Height = 456
Top = 0
Width = 400
Width = 439
AxisList = <
item
Grid.Visible = False
@ -327,37 +327,26 @@ object frmMain: TfrmMain
)
Align = alClient
DoubleBuffered = True
object DataSeries: TLineSeries
Title = 'Test data'
AxisIndexX = 1
AxisIndexY = 0
LinePen.Style = psClear
Pointer.Brush.Color = clBlack
Pointer.HorizSize = 1
Pointer.Style = psCross
Pointer.VertSize = 1
ShowPoints = True
Source = ListChartSource
end
object FitSeries: TFitSeries
Legend.Format = '%0:s: %2:s'
Title = 'fitted data'
AxisIndexX = 1
AxisIndexY = 0
OnFitComplete = FitCompleteHandler
Pen.Color = clRed
Pointer.Style = psCross
Source = ListChartSource
OnFitComplete = FitCompleteHandler
end
end
object pnlLog: TPanel
Left = 0
Height = 31
Top = 456
Width = 400
Width = 439
Align = alBottom
BevelOuter = bvNone
ClientHeight = 31
ClientWidth = 400
ClientWidth = 439
TabOrder = 1
object cbLogX: TCheckBox
Left = 48

View File

@ -6,8 +6,8 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls, Spin, Buttons, TAGraph, TASeries, TASources,
TAFuncSeries, TATransformations;
StdCtrls, Spin, Buttons,
TAGraph, TASources, TAFuncSeries, TATransformations;
type
@ -18,7 +18,6 @@ type
Chart: TChart;
cbDrawFitRangeOnly: TCheckBox;
FitSeries: TFitSeries;
DataSeries: TLineSeries;
cbFitRangeUseMin:TCheckBox;
cbFitRangeUseMax:TCheckBox;
cbFitEquation: TComboBox;
@ -199,21 +198,21 @@ begin
ymin := MinValue(yarr);
ymax := MaxValue(yarr);
maxNoise := edNoiseY.Value * (ymax - ymin) * 0.01;
DataSeries.BeginUpdate;
FitSeries.BeginUpdate;
try
DataSeries.Clear;
FitSeries.Clear;
for i := 0 to High(xarr) do begin
x := xarr[i];
y := yarr[i] + maxNoise * (Random - 0.5);
if TFitEquation(cbTestFunction.ItemIndex) = feExp then
// Make sure that the noise generation does not produce negative
// values for the exponential data set.
while y < 0 do
while y <= 0 do
y := yarr[i] + maxNoise * (Random - 0.5);
DataSeries.AddXY(x, y);
FitSeries.AddXY(x, y);
end;
finally
DataSeries.EndUpdate;
FitSeries.EndUpdate;
end;
end;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
@ -13,9 +13,6 @@
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<BuildModes Count="1">
<Item1 Name="Default" Default="True"/>
</BuildModes>