LazStats: Integrate Report and Chart in form of XvsMultYUnit.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7687 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-09-22 13:20:08 +00:00
parent 84e1cce0ed
commit 3395fc8847
10 changed files with 524 additions and 594 deletions

View File

@@ -1,26 +1,26 @@
object BoxPlotFrm: TBoxPlotFrm object BoxPlotFrm: TBoxPlotFrm
Left = 1155 Left = 449
Height = 387 Height = 500
Top = 194 Top = 211
Width = 817 Width = 1000
HelpType = htKeyword HelpType = htKeyword
HelpKeyword = 'html/BoxPlots.htm' HelpKeyword = 'html/BoxPlots.htm'
Caption = 'Box Plot' Caption = 'Box Plot'
ClientHeight = 387 ClientHeight = 500
ClientWidth = 817 ClientWidth = 1000
OnActivate = FormActivate OnActivate = FormActivate
OnCreate = FormCreate OnCreate = FormCreate
Position = poMainFormCenter Position = poMainFormCenter
LCLVersion = '2.1.0.0' LCLVersion = '2.1.0.0'
object ParamsPanel: TPanel object ParamsPanel: TPanel
Left = 8 Left = 8
Height = 371 Height = 484
Top = 8 Top = 8
Width = 333 Width = 333
Align = alLeft Align = alLeft
BorderSpacing.Around = 8 BorderSpacing.Around = 8
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 371 ClientHeight = 484
ClientWidth = 333 ClientWidth = 333
TabOrder = 0 TabOrder = 0
object CloseBtn: TButton object CloseBtn: TButton
@@ -30,7 +30,7 @@ object BoxPlotFrm: TBoxPlotFrm
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 278 Left = 278
Height = 25 Height = 25
Top = 346 Top = 459
Width = 55 Width = 55
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
@@ -46,7 +46,7 @@ object BoxPlotFrm: TBoxPlotFrm
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 194 Left = 194
Height = 25 Height = 25
Top = 346 Top = 459
Width = 76 Width = 76
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
@@ -63,7 +63,7 @@ object BoxPlotFrm: TBoxPlotFrm
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 132 Left = 132
Height = 25 Height = 25
Top = 346 Top = 459
Width = 54 Width = 54
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
@@ -81,7 +81,7 @@ object BoxPlotFrm: TBoxPlotFrm
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 73 Left = 73
Height = 25 Height = 25
Top = 346 Top = 459
Width = 51 Width = 51
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
@@ -98,7 +98,7 @@ object BoxPlotFrm: TBoxPlotFrm
AnchorSideBottom.Control = CloseBtn AnchorSideBottom.Control = CloseBtn
Left = 0 Left = 0
Height = 8 Height = 8
Top = 330 Top = 443
Width = 333 Width = 333
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
Shape = bsBottomLine Shape = bsBottomLine
@@ -120,7 +120,7 @@ object BoxPlotFrm: TBoxPlotFrm
AnchorSideRight.Control = MeasInBtn AnchorSideRight.Control = MeasInBtn
AnchorSideBottom.Control = Bevel2 AnchorSideBottom.Control = Bevel2
Left = 0 Left = 0
Height = 313 Height = 426
Top = 17 Top = 17
Width = 145 Width = 145
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
@@ -267,16 +267,16 @@ object BoxPlotFrm: TBoxPlotFrm
end end
object ParamsSplitter: TSplitter object ParamsSplitter: TSplitter
Left = 349 Left = 349
Height = 387 Height = 500
Top = 0 Top = 0
Width = 5 Width = 5
ResizeStyle = rsPattern ResizeStyle = rsPattern
end end
object PageControl1: TPageControl object PageControl1: TPageControl
Left = 362 Left = 362
Height = 371 Height = 484
Top = 8 Top = 8
Width = 447 Width = 630
ActivePage = ReportPage ActivePage = ReportPage
Align = alClient Align = alClient
BorderSpacing.Around = 8 BorderSpacing.Around = 8

View File

@@ -387,6 +387,9 @@ procedure TBoxPlotFrm.FormCreate(Sender: TObject);
begin begin
Assert(OS3MainFrm <> nil); Assert(OS3MainFrm <> nil);
Width := Scale96ToFont(DEFAULT_WIDTH);
Height := Scale96ToFont(DEFAULT_HEIGHT);
FReportFrame := TReportFrame.Create(self); FReportFrame := TReportFrame.Create(self);
FReportFrame.Parent := ReportPage; FReportFrame.Parent := ReportPage;
FReportFrame.Align := alClient; FReportFrame.Align := alClient;

View File

@@ -400,6 +400,9 @@ begin
Assert(OS3MainFrm <> nil); Assert(OS3MainFrm <> nil);
if DictionaryFrm = nil then Application.CreateForm(TDictionaryFrm, DictionaryFrm); if DictionaryFrm = nil then Application.CreateForm(TDictionaryFrm, DictionaryFrm);
Width := Scale96ToFont(DEFAULT_WIDTH);
Height := Scale96ToFont(DEFAULT_HEIGHT);
FReportFrame := TReportFrame.Create(self); FReportFrame := TReportFrame.Create(self);
FReportFrame.Parent := ReportPage; FReportFrame.Parent := ReportPage;
FReportFrame.Align := alClient; FReportFrame.Align := alClient;
@@ -617,6 +620,9 @@ begin
XOutBtn.Enabled := XEdit.Text <> ''; XOutBtn.Enabled := XEdit.Text <> '';
YOutBtn.Enabled := YEdit.Text <> ''; YOutBtn.Enabled := YEdit.Text <> '';
SizeOutBtn.Enabled := SizeEdit.Text <> ''; SizeOutBtn.Enabled := SizeEdit.Text <> '';
FReportFrame.UpdateBtnStates;
FChartFrame.UpdateBtnStates;
end; end;

View File

@@ -128,6 +128,9 @@ begin
Assert(OS3MainFrm <> nil); Assert(OS3MainFrm <> nil);
if DictionaryFrm = nil then Application.CreateForm(TDictionaryFrm, DictionaryFrm); if DictionaryFrm = nil then Application.CreateForm(TDictionaryFrm, DictionaryFrm);
Width := Scale96ToFont(DEFAULT_WIDTH);
Height := Scale96ToFont(DEFAULT_HEIGHT);
FReportFrame := TReportFrame.Create(self); FReportFrame := TReportFrame.Create(self);
FReportFrame.Parent := ReportPanel; FReportFrame.Parent := ReportPanel;
FReportFrame.Align := alClient; FReportFrame.Align := alClient;

View File

@@ -1,26 +1,26 @@
object PlotXYFrm: TPlotXYFrm object PlotXYFrm: TPlotXYFrm
Left = 522 Left = 427
Height = 348 Height = 500
Top = 172 Top = 175
Width = 847 Width = 1000
HelpType = htKeyword HelpType = htKeyword
HelpKeyword = 'html/XVersusYPlot.htm' HelpKeyword = 'html/XVersusYPlot.htm'
Caption = 'Plot X versus Y' Caption = 'Plot X versus Y'
ClientHeight = 348 ClientHeight = 500
ClientWidth = 847 ClientWidth = 1000
OnActivate = FormActivate OnActivate = FormActivate
OnCreate = FormCreate OnCreate = FormCreate
Position = poMainFormCenter Position = poMainFormCenter
LCLVersion = '2.1.0.0' LCLVersion = '2.1.0.0'
object ParamsPanel: TPanel object ParamsPanel: TPanel
Left = 8 Left = 8
Height = 332 Height = 484
Top = 8 Top = 8
Width = 376 Width = 376
Align = alLeft Align = alLeft
BorderSpacing.Around = 8 BorderSpacing.Around = 8
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 332 ClientHeight = 484
ClientWidth = 376 ClientWidth = 376
TabOrder = 0 TabOrder = 0
object CloseBtn: TButton object CloseBtn: TButton
@@ -30,7 +30,7 @@ object PlotXYFrm: TPlotXYFrm
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 314 Left = 314
Height = 25 Height = 25
Top = 307 Top = 459
Width = 62 Width = 62
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
BorderSpacing.Left = 8 BorderSpacing.Left = 8
@@ -46,7 +46,7 @@ object PlotXYFrm: TPlotXYFrm
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 230 Left = 230
Height = 25 Height = 25
Top = 307 Top = 459
Width = 76 Width = 76
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
BorderSpacing.Left = 8 BorderSpacing.Left = 8
@@ -62,7 +62,7 @@ object PlotXYFrm: TPlotXYFrm
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 168 Left = 168
Height = 25 Height = 25
Top = 307 Top = 459
Width = 54 Width = 54
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
BorderSpacing.Left = 12 BorderSpacing.Left = 12
@@ -79,7 +79,7 @@ object PlotXYFrm: TPlotXYFrm
AnchorSideBottom.Control = CloseBtn AnchorSideBottom.Control = CloseBtn
Left = 0 Left = 0
Height = 8 Height = 8
Top = 291 Top = 443
Width = 376 Width = 376
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
Shape = bsBottomLine Shape = bsBottomLine
@@ -102,7 +102,7 @@ object PlotXYFrm: TPlotXYFrm
AnchorSideBottom.Control = Bevel1 AnchorSideBottom.Control = Bevel1
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 0 Left = 0
Height = 274 Height = 426
Top = 17 Top = 17
Width = 167 Width = 167
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
@@ -326,16 +326,16 @@ object PlotXYFrm: TPlotXYFrm
end end
object ParamsSplitter: TSplitter object ParamsSplitter: TSplitter
Left = 392 Left = 392
Height = 348 Height = 500
Top = 0 Top = 0
Width = 5 Width = 5
ResizeStyle = rsPattern ResizeStyle = rsPattern
end end
object PageControl1: TPageControl object PageControl1: TPageControl
Left = 405 Left = 405
Height = 332 Height = 484
Top = 8 Top = 8
Width = 434 Width = 587
ActivePage = ChartPage ActivePage = ChartPage
Align = alClient Align = alClient
BorderSpacing.Around = 8 BorderSpacing.Around = 8

View File

@@ -377,6 +377,9 @@ procedure TPlotXYFrm.FormCreate(Sender: TObject);
begin begin
Assert(OS3MainFrm <> nil); Assert(OS3MainFrm <> nil);
Width := Scale96ToFont(DEFAULT_WIDTH);
Height := Scale96ToFont(DEFAULT_HEIGHT);
FReportFrame := TReportFrame.Create(self); FReportFrame := TReportFrame.Create(self);
FReportFrame.Parent := ReportPage; FReportFrame.Parent := ReportPage;
FReportFrame.Align := alClient; FReportFrame.Align := alClient;

View File

@@ -1,118 +1,47 @@
object XvsMultYForm: TXvsMultYForm object XvsMultYForm: TXvsMultYForm
Left = 288 Left = 288
Height = 467 Height = 500
Top = 117 Top = 117
Width = 452 Width = 1000
HelpType = htKeyword HelpType = htKeyword
HelpKeyword = 'html/PlotXVersusMultipleYValues.htm' HelpKeyword = 'html/PlotXVersusMultipleYValues.htm'
Caption = 'X vs Multiple Y Plot' Caption = 'X vs Multiple Y Plot'
ClientHeight = 467 ClientHeight = 500
ClientWidth = 452 ClientWidth = 1000
OnActivate = FormActivate OnActivate = FormActivate
OnCreate = FormCreate OnCreate = FormCreate
OnShow = ResetBtnClick OnShow = ResetBtnClick
Position = poMainFormCenter Position = poMainFormCenter
LCLVersion = '2.1.0.0' LCLVersion = '2.1.0.0'
object Label4: TLabel object ParamsPanel: TPanel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = PlotTitleEdit
AnchorSideTop.Side = asrCenter
Left = 8 Left = 8
Height = 15 Height = 484
Top = 332 Top = 8
Width = 49 Width = 296
BorderSpacing.Left = 8 Align = alLeft
Caption = 'Plot Title:'
ParentColor = False
end
object PlotTitleEdit: TEdit
AnchorSideLeft.Control = Label4
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = GroupBox1
Left = 65
Height = 23
Top = 328
Width = 379
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Right = 8
TabOrder = 1
TextHint = 'Title above the chart'
end
object GroupBox1: TGroupBox
AnchorSideLeft.Control = Owner
AnchorSideBottom.Control = Bevel2
Left = 8
Height = 51
Top = 359
Width = 336
Anchors = [akLeft, akBottom]
AutoSize = True
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 8 BorderSpacing.Top = 8
BorderSpacing.Bottom = 8 BorderSpacing.Right = 4
Caption = 'Options'
ChildSizing.LeftRightSpacing = 12
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 24
ChildSizing.VerticalSpacing = 2
ChildSizing.EnlargeHorizontal = crsScaleChilds
ChildSizing.EnlargeVertical = crsScaleChilds
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 2
ClientHeight = 31
ClientWidth = 332
TabOrder = 2
object DescChk: TCheckBox
Left = 12
Height = 19
Top = 6
Width = 127
BorderSpacing.Left = 12
BorderSpacing.Top = 2
Caption = 'Descriptive Statistics'
Checked = True
State = cbChecked
TabOrder = 0
end
object LinesBox: TCheckBox
AnchorSideTop.Side = asrBottom
Left = 163
Height = 19
Top = 6
Width = 157
BorderSpacing.Left = 12
BorderSpacing.Top = 2
BorderSpacing.Right = 6
BorderSpacing.Bottom = 6
Caption = 'Connect Points with Lines'
TabOrder = 1
end
end
object Panel1: TPanel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Memo1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = PlotTitleEdit
Left = 8
Height = 214
Top = 106
Width = 436
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 214 ClientHeight = 484
ClientWidth = 436 ClientWidth = 296
Constraints.MinHeight = 200 TabOrder = 0
object Panel1: TPanel
AnchorSideLeft.Control = ParamsPanel
AnchorSideTop.Control = ParamsPanel
AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = PlotTitleEdit
Left = 0
Height = 345
Top = 0
Width = 296
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Bottom = 8
BevelOuter = bvNone
ClientHeight = 345
ClientWidth = 296
TabOrder = 0 TabOrder = 0
object Label1: TLabel object Label1: TLabel
AnchorSideLeft.Control = Panel1 AnchorSideLeft.Control = Panel1
@@ -132,14 +61,15 @@ object XvsMultYForm: TXvsMultYForm
AnchorSideBottom.Control = Panel1 AnchorSideBottom.Control = Panel1
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 0 Left = 0
Height = 197 Height = 328
Top = 17 Top = 17
Width = 196 Width = 126
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Top = 2 BorderSpacing.Top = 2
BorderSpacing.Right = 8 BorderSpacing.Right = 8
ItemHeight = 0 ItemHeight = 0
MultiSelect = True MultiSelect = True
OnDblClick = VarListDblClick
OnSelectionChange = VarListSelectionChange OnSelectionChange = VarListSelectionChange
TabOrder = 0 TabOrder = 0
end end
@@ -147,7 +77,7 @@ object XvsMultYForm: TXvsMultYForm
AnchorSideLeft.Control = Panel1 AnchorSideLeft.Control = Panel1
AnchorSideLeft.Side = asrCenter AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = VarList AnchorSideTop.Control = VarList
Left = 204 Left = 134
Height = 28 Height = 28
Top = 17 Top = 17
Width = 28 Width = 28
@@ -162,7 +92,7 @@ object XvsMultYForm: TXvsMultYForm
AnchorSideLeft.Side = asrCenter AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = XInBtn AnchorSideTop.Control = XInBtn
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 204 Left = 134
Height = 28 Height = 28
Top = 49 Top = 49
Width = 28 Width = 28
@@ -176,12 +106,13 @@ object XvsMultYForm: TXvsMultYForm
object YInBtn: TBitBtn object YInBtn: TBitBtn
AnchorSideLeft.Control = Panel1 AnchorSideLeft.Control = Panel1
AnchorSideLeft.Side = asrCenter AnchorSideLeft.Side = asrCenter
AnchorSideBottom.Control = Bevel1 AnchorSideTop.Control = XOutBtn
Left = 204 AnchorSideTop.Side = asrBottom
Left = 134
Height = 28 Height = 28
Top = 133 Top = 101
Width = 28 Width = 28
Anchors = [akLeft, akBottom] BorderSpacing.Top = 24
Images = MainDataModule.ImageList Images = MainDataModule.ImageList
ImageIndex = 1 ImageIndex = 1
OnClick = YInBtnClick OnClick = YInBtnClick
@@ -191,12 +122,13 @@ object XvsMultYForm: TXvsMultYForm
object YOutBtn: TBitBtn object YOutBtn: TBitBtn
AnchorSideLeft.Control = Panel1 AnchorSideLeft.Control = Panel1
AnchorSideLeft.Side = asrCenter AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Bevel1 AnchorSideTop.Control = YInBtn
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 204 Left = 134
Height = 28 Height = 28
Top = 165 Top = 133
Width = 28 Width = 28
BorderSpacing.Top = 4
Images = MainDataModule.ImageList Images = MainDataModule.ImageList
ImageIndex = 0 ImageIndex = 0
OnClick = YOutBtnClick OnClick = YOutBtnClick
@@ -206,7 +138,7 @@ object XvsMultYForm: TXvsMultYForm
object Label2: TLabel object Label2: TLabel
AnchorSideLeft.Control = XEdit AnchorSideLeft.Control = XEdit
AnchorSideBottom.Control = XEdit AnchorSideBottom.Control = XEdit
Left = 240 Left = 170
Height = 15 Height = 15
Top = 25 Top = 25
Width = 54 Width = 54
@@ -217,12 +149,11 @@ object XvsMultYForm: TXvsMultYForm
end end
object Label3: TLabel object Label3: TLabel
AnchorSideLeft.Control = YBox AnchorSideLeft.Control = YBox
AnchorSideBottom.Control = YBox AnchorSideTop.Control = YInBtn
Left = 240 Left = 170
Height = 15 Height = 15
Top = 95 Top = 101
Width = 64 Width = 64
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 2 BorderSpacing.Bottom = 2
Caption = 'Y Variable(s)' Caption = 'Y Variable(s)'
ParentColor = False ParentColor = False
@@ -234,10 +165,10 @@ object XvsMultYForm: TXvsMultYForm
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = XOutBtn AnchorSideBottom.Control = XOutBtn
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 240 Left = 170
Height = 23 Height = 23
Top = 42 Top = 42
Width = 196 Width = 126
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Bottom = 12 BorderSpacing.Bottom = 12
@@ -248,14 +179,16 @@ object XvsMultYForm: TXvsMultYForm
object YBox: TListBox object YBox: TListBox
AnchorSideLeft.Control = YInBtn AnchorSideLeft.Control = YInBtn
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Label3
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Panel1 AnchorSideRight.Control = Panel1
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Panel1 AnchorSideBottom.Control = Panel1
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 240 Left = 170
Height = 102 Height = 227
Top = 112 Top = 118
Width = 196 Width = 126
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 8 BorderSpacing.Left = 8
ItemHeight = 0 ItemHeight = 0
@@ -263,117 +196,179 @@ object XvsMultYForm: TXvsMultYForm
OnSelectionChange = VarListSelectionChange OnSelectionChange = VarListSelectionChange
TabOrder = 6 TabOrder = 6
end end
object Bevel1: TBevel
AnchorSideTop.Control = YBox
AnchorSideTop.Side = asrCenter
Left = 210
Height = 4
Top = 161
Width = 14
Shape = bsSpacer
end
end
object Memo1: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 8
Height = 90
Top = 8
Width = 436
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 8
BorderSpacing.Top = 8
BorderSpacing.Right = 8
Caption = 'Directions: '#13#10'1. Select the X variable common to all of the Y variables to be selected.'#13#10'2. Select the Y variables.'#13#10'3. Enter a label for the plot.'#13#10'4. Select the options desired.'#13#10'5. Click the Compute button to obtain results.'
ParentColor = False
end end
object CloseBtn: TButton object CloseBtn: TButton
AnchorSideRight.Control = Owner AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = ParamsPanel
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 385 Left = 241
Height = 25 Height = 25
Top = 434 Top = 459
Width = 55 Width = 55
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 8 BorderSpacing.Top = 8
BorderSpacing.Right = 12
BorderSpacing.Bottom = 8
Caption = 'Close' Caption = 'Close'
ModalResult = 11 ModalResult = 11
OnClick = CloseBtnClick OnClick = CloseBtnClick
TabOrder = 3 TabOrder = 1
end end
object ComputeBtn: TButton object ComputeBtn: TButton
AnchorSideRight.Control = CloseBtn AnchorSideRight.Control = CloseBtn
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = ParamsPanel
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 297 Left = 157
Height = 25 Height = 25
Top = 434 Top = 459
Width = 76 Width = 76
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Top = 8 BorderSpacing.Top = 8
BorderSpacing.Right = 12 BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Compute' Caption = 'Compute'
OnClick = ComputeBtnClick OnClick = ComputeBtnClick
TabOrder = 4 TabOrder = 2
end end
object ResetBtn: TButton object ResetBtn: TButton
AnchorSideRight.Control = ComputeBtn AnchorSideRight.Control = ComputeBtn
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = ParamsPanel
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 235 Left = 95
Height = 25 Height = 25
Top = 434 Top = 459
Width = 54 Width = 54
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Left = 12 BorderSpacing.Left = 8
BorderSpacing.Top = 8 BorderSpacing.Top = 8
BorderSpacing.Right = 8 BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Caption = 'Reset' Caption = 'Reset'
OnClick = ResetBtnClick OnClick = ResetBtnClick
TabOrder = 5 TabOrder = 3
end end
object Bevel2: TBevel object Bevel2: TBevel
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = ParamsPanel
AnchorSideRight.Control = Owner AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = CloseBtn AnchorSideBottom.Control = CloseBtn
Left = 0 Left = 0
Height = 8 Height = 8
Top = 418 Top = 443
Width = 452 Width = 296
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
Shape = bsBottomLine Shape = bsBottomLine
end end
object HelpBtn: TButton object HelpBtn: TButton
Tag = 161 Tag = 161
AnchorSideRight.Control = ResetBtn AnchorSideRight.Control = ResetBtn
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = ParamsPanel
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 172 Left = 36
Height = 25 Height = 25
Top = 434 Top = 459
Width = 51 Width = 51
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Top = 8
BorderSpacing.Right = 8
Caption = 'Help'
OnClick = HelpBtnClick
TabOrder = 4
end
object GroupBox1: TGroupBox
AnchorSideLeft.Control = ParamsPanel
AnchorSideBottom.Control = Bevel2
Left = 0
Height = 51
Top = 384
Width = 185
Anchors = [akLeft, akBottom]
AutoSize = True
BorderSpacing.Top = 8
BorderSpacing.Bottom = 8
Caption = 'Options'
ChildSizing.LeftRightSpacing = 12
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 24
ChildSizing.VerticalSpacing = 2
ChildSizing.EnlargeHorizontal = crsScaleChilds
ChildSizing.EnlargeVertical = crsScaleChilds
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 2
ClientHeight = 31
ClientWidth = 181
TabOrder = 5
object LinesBox: TCheckBox
AnchorSideTop.Side = asrBottom
Left = 12
Height = 19
Top = 6
Width = 157
BorderSpacing.Left = 12 BorderSpacing.Left = 12
BorderSpacing.Top = 2
BorderSpacing.Right = 6
BorderSpacing.Bottom = 6
Caption = 'Connect Points with Lines'
TabOrder = 0
end
end
object Label4: TLabel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = PlotTitleEdit
AnchorSideTop.Side = asrCenter
Left = 8
Height = 15
Top = 357
Width = 49
Caption = 'Plot Title:'
ParentColor = False
end
object PlotTitleEdit: TEdit
AnchorSideLeft.Control = Label4
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = ParamsPanel
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = GroupBox1
Left = 65
Height = 23
Top = 353
Width = 231
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Left = 8
TabOrder = 6
TextHint = 'Title above the chart'
end
end
object ParamsSplitter: TSplitter
Left = 308
Height = 500
Top = 0
Width = 5
ResizeStyle = rsPattern
end
object PageControl1: TPageControl
Left = 317
Height = 484
Top = 8
Width = 675
ActivePage = ReportPage
Align = alClient
BorderSpacing.Left = 4
BorderSpacing.Top = 8 BorderSpacing.Top = 8
BorderSpacing.Right = 8 BorderSpacing.Right = 8
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
Caption = 'Help' TabIndex = 0
OnClick = HelpBtnClick TabOrder = 2
TabOrder = 6 object ReportPage: TTabSheet
Caption = 'Report'
end
object ChartPage: TTabSheet
Caption = 'Chart'
end
end end
end end

View File

@@ -3,33 +3,35 @@
unit XvsMultYUnit; unit XvsMultYUnit;
{$MODE objfpc}{$H+} {$MODE objfpc}{$H+}
{$I ../../../LazStats.inc}
interface interface
uses uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
StdCtrls, Buttons, ExtCtrls, Printers, StdCtrls, Buttons, ExtCtrls, Printers, ComCtrls,
MainUnit, Globals, ContextHelpUnit, OutputUnit, DataProcs, MatrixLib; MainUnit, Globals, ContextHelpUnit, DataProcs, MatrixLib,
ReportFrameUnit, ChartFrameUnit;
type type
{ TXvsMultYForm } { TXvsMultYForm }
TXvsMultYForm = class(TForm) TXvsMultYForm = class(TForm)
Bevel1: TBevel;
Bevel2: TBevel; Bevel2: TBevel;
LinesBox: TCheckBox; LinesBox: TCheckBox;
DescChk: TCheckBox;
GroupBox1: TGroupBox; GroupBox1: TGroupBox;
Memo1: TLabel; PageControl1: TPageControl;
Panel1: TPanel; Panel1: TPanel;
ParamsPanel: TPanel;
ResetBtn: TButton; ResetBtn: TButton;
ComputeBtn: TButton; ComputeBtn: TButton;
CloseBtn: TButton; CloseBtn: TButton;
PlotTitleEdit: TEdit; PlotTitleEdit: TEdit;
Label4: TLabel; Label4: TLabel;
HelpBtn: TButton; HelpBtn: TButton;
ParamsSplitter: TSplitter;
ReportPage: TTabSheet;
ChartPage: TTabSheet;
YBox: TListBox; YBox: TListBox;
XEdit: TEdit; XEdit: TEdit;
Label2: TLabel; Label2: TLabel;
@@ -46,6 +48,7 @@ type
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure HelpBtnClick(Sender: TObject); procedure HelpBtnClick(Sender: TObject);
procedure ResetBtnClick(Sender: TObject); procedure ResetBtnClick(Sender: TObject);
procedure VarListDblClick(Sender: TObject);
procedure VarListSelectionChange(Sender: TObject; User: boolean); procedure VarListSelectionChange(Sender: TObject; User: boolean);
procedure XInBtnClick(Sender: TObject); procedure XInBtnClick(Sender: TObject);
procedure XOutBtnClick(Sender: TObject); procedure XOutBtnClick(Sender: TObject);
@@ -53,14 +56,11 @@ type
procedure YOutBtnClick(Sender: TObject); procedure YOutBtnClick(Sender: TObject);
private private
{ private declarations } { private declarations }
FReportFrame: TReportFrame;
FChartFrame: TChartFrame;
FAutoSized: Boolean; FAutoSized: Boolean;
selected: IntDyneVec; selected: IntDyneVec;
{$IFDEF USE_TACHART}
procedure PlotXY(XValues: DblDyneVec; YValues: DblDyneMat); procedure PlotXY(XValues: DblDyneVec; YValues: DblDyneMat);
{$ELSE}
procedure PlotXY(XValues: DblDyneVec; YValues: DblDyneMat;
MaxX, MinX, MaxY, MinY: double; N, NoY: integer);
{$ENDIF}
procedure UpdateBtnStates; procedure UpdateBtnStates;
public public
{ public declarations } { public declarations }
@@ -70,50 +70,27 @@ type
var var
XvsMultYForm: TXvsMultYForm; XvsMultYForm: TXvsMultYForm;
implementation implementation
{$R *.lfm} {$R *.lfm}
uses uses
{$IFDEF USE_TACHART}
TAChartUtils, TAChartUtils,
ChartFrameUnit, ChartUnit,
{$ELSE}
BlankFrmUnit,
{$ENDIF}
Math, Utils; Math, Utils;
{ TXvsMultYForm } { TXvsMultYForm }
procedure TXvsMultYForm.Reset; procedure TXvsMultYForm.CloseBtnClick(Sender: TObject);
var
i: integer;
begin begin
VarList.Clear; Close;
YBox.Clear;
XEdit.Clear;
XInBtn.Enabled := true;
XOutBtn.Enabled := false;
YInBtn.Enabled := true;
YOutBtn.Enabled := false;
PlotTitleEdit.Text := '';
for i := 1 to NoVariables do
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
end; end;
procedure TXvsMultYForm.ResetBtnClick(Sender: TObject);
begin
Reset;
end;
procedure TXvsMultYForm.VarListSelectionChange(Sender: TObject; User: boolean);
begin
UpdateBtnStates;
end;
procedure TXvsMultYForm.ComputeBtnClick(Sender: TObject); procedure TXvsMultYForm.ComputeBtnClick(Sender: TObject);
var var
i, j, k, N, NoY, XCol, NoSelected: integer; i, j, N, NoY, XCol, NoSelected: integer;
MinX, MaxX, MinY, MaxY: double; MinX, MaxX, MinY, MaxY: double;
Title: string; Title: string;
RMatrix: DblDyneMat = nil; RMatrix: DblDyneMat = nil;
@@ -216,8 +193,6 @@ begin
end; end;
// get descriptive data // get descriptive data
if DescChk.Checked then
begin
lReport.Add('X VERSUS MULTIPLE Y VALUES PLOT'); lReport.Add('X VERSUS MULTIPLE Y VALUES PLOT');
lReport.Add(''); lReport.Add('');
@@ -232,14 +207,13 @@ begin
Title := 'Standard Deviations'; Title := 'Standard Deviations';
DynVectorPrint(StdDevs, NoSelected, Title, RowLabels, N, lReport); DynVectorPrint(StdDevs, NoSelected, Title, RowLabels, N, lReport);
DisplayReport(lReport); FReportFrame.DisplayReport(lReport);
end;
// Sort on X // Sort on X
SortOnX(XValues, YValues); SortOnX(XValues, YValues);
// Plot x vs multiple y // Plot x vs multiple y
PlotXY(XValues, YValues{$IFNDEF USE_TACHART}, MaxX, MinX, MaxY, MinY, N, NoY{$ENDIF}); PlotXY(XValues, YValues);
finally finally
lReport.Free; lReport.Free;
@@ -256,12 +230,6 @@ begin
end; end;
procedure TXvsMultYForm.CloseBtnClick(Sender: TObject);
begin
Close;
end;
procedure TXvsMultYForm.FormActivate(Sender: TObject); procedure TXvsMultYForm.FormActivate(Sender: TObject);
var var
w: Integer; w: Integer;
@@ -275,8 +243,16 @@ begin
ComputeBtn.Constraints.MinWidth := w; ComputeBtn.Constraints.MinWidth := w;
CloseBtn.Constraints.MinWidth := w; CloseBtn.Constraints.MinWidth := w;
Constraints.MinWidth := Width; Panel1.Constraints.MinHeight := YOutBtn.Top + YOutBtn.Height;
Constraints.MinHeight := Height; ParamsPanel.Constraints.MinWidth := 4*w + 3*CloseBtn.BorderSpacing.Left;
ParamsPanel.Constraints.MinHeight := Panel1.Constraints.MinHeight + Panel1.BorderSpacing.Bottom +
PlotTitleEdit.Height + GroupBox1.Height + 2*GroupBox1.BorderSpacing.Top +
Bevel2.Height + CloseBtn.Height + CloseBtn.BorderSpacing.Top;
Constraints.MinHeight := ParamsPanel.Constraints.MinHeight + 2*ParamsPanel.BorderSpacing.Top;
Constraints.MinWidth := ParamsPanel.Constraints.MinWidth + 200;
if Height < Constraints.MinHeight then Height := 1; // enforce autosizing if needed
if Width < Constraints.MinWidth then Width :=1;
Position := poDesigned; Position := poDesigned;
FAutoSized := true; FAutoSized := true;
@@ -286,6 +262,20 @@ end;
procedure TXvsMultYForm.FormCreate(Sender: TObject); procedure TXvsMultYForm.FormCreate(Sender: TObject);
begin begin
Assert(OS3MainFrm <> nil); Assert(OS3MainFrm <> nil);
Width := Scale96ToFont(DEFAULT_WIDTH);
Height := Scale96ToFont(DEFAULT_HEIGHT);
FReportFrame := TReportFrame.Create(self);
FReportFrame.Parent := ReportPage;
FReportFrame.Align := alClient;
FChartFrame := TChartFrame.Create(self);
FChartFrame.Parent := ChartPage;
FChartFrame.Align := alClient;
FChartFrame.Chart.BottomAxis.Intervals.MaxLength := 80;
FChartFrame.Chart.BottomAxis.Intervals.MinLength := 30;
Reset; Reset;
end; end;
@@ -298,6 +288,95 @@ begin
end; end;
// Routine to plot X versus multiple Y values
// Unlike many other routines in LazStats the curve index in YValues is the
// first one, the point index is the second one.
procedure TXvsMultYForm.PlotXY(XValues: DblDyneVec; YValues: DblDyneMat);
var
N, Ny, Nc: Integer;
j: Integer;
pt: TPlotType;
begin
// Preparations
if LinesBox.Checked then pt := ptLinesAndSymbols else pt := ptSymbols;
N := Length(XValues);
Ny := Length(YValues);
Nc := Length(DATA_COLORS);
FChartFrame.Clear;
// Titles
FChartFrame.SetTitle(PlotTitleEdit.Text);
FChartFrame.SetXTitle(XEdit.Text);
FChartFrame.SetYTitle('Y Values');
// Plot a series for each y value
for j := 0 to Ny - 1 do
FChartFrame.PlotXY(pt, XValues, YValues[j], nil, nil, Trim(YBox.Items[j]), DATA_COLORS[j mod Nc]);
end;
procedure TXvsMultYForm.Reset;
var
i: integer;
begin
VarList.Clear;
YBox.Clear;
XEdit.Clear;
XInBtn.Enabled := true;
XOutBtn.Enabled := false;
YInBtn.Enabled := true;
YOutBtn.Enabled := false;
PlotTitleEdit.Text := '';
for i := 1 to NoVariables do
VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]);
end;
procedure TXvsMultYForm.ResetBtnClick(Sender: TObject);
begin
Reset;
end;
procedure TXvsMultYForm.UpdateBtnStates;
var
lSelected: Boolean;
begin
lSelected := AnySelected(VarList);
XInBtn.Enabled := lSelected and (XEdit.Text = '');
YInBtn.Enabled := lSelected;
xOutBtn.Enabled := (XEdit.Text <> '');
YOutBtn.Enabled := AnySelected(YBox);
FReportFrame.UpdateBtnStates;
FChartFrame.UpdateBtnStates;
end;
procedure TXvsMultYForm.VarListDblClick(Sender: TObject);
var
index: integer;
begin
index := VarList.ItemIndex;
if index > -1 then
begin
if XEdit.Text = '' then
XEdit.Text := VarList.Items[index]
else
YBox.Items.Add(VarList.Items[index]);
VarList.Items.Delete(index);
UpdateBtnStates;
end;
end;
procedure TXvsMultYForm.VarListSelectionChange(Sender: TObject; User: boolean);
begin
UpdateBtnStates;
end;
procedure TXvsMultYForm.XInBtnClick(Sender: TObject); procedure TXvsMultYForm.XInBtnClick(Sender: TObject);
var var
index: integer; index: integer;
@@ -361,170 +440,5 @@ begin
end; end;
// Routine to plot X versus multiple Y values
// Unlike many other routines in LazStats the curve index in YValues is the
// first one, the point index is the second one.
{$IFDEF USE_TACHART}
procedure TXvsMultYForm.PlotXY(XValues: DblDyneVec; YValues: DblDyneMat);
var
N, Ny, Nc: Integer;
j: Integer;
pt: TPlotType;
begin
// Preparations
if LinesBox.Checked then pt := ptLinesAndSymbols else pt := ptSymbols;
N := Length(XValues);
Ny := Length(YValues);
Nc := Length(DATA_COLORS);
if ChartForm = nil then
ChartForm := TChartForm.Create(Application)
else
ChartForm.Clear;
// Titles
ChartForm.SetTitle(PlotTitleEdit.Text);
ChartForm.SetXTitle(XEdit.Text);
ChartForm.SetYTitle('Y Values');
// Plot a series for each y value
for j := 0 to Ny - 1 do
ChartForm.PlotXY(pt, XValues, YValues[j], nil, nil, Trim(YBox.Items[j]), DATA_COLORS[j mod Nc]);
// Show chart
ChartForm.ShowModal;
end;
{$ELSE}
procedure TXvsMultYForm.PlotXY(XValues: DblDyneVec; YValues: DblDyneMat;
MaxX, MinX, MaxY, MinY: double; N, NoY: integer);
var
i, j, xpos, ypos, hleft, hright, vtop, vbottom, imagewide: integer;
vhi, hwide, offset, strhi, imagehi: integer;
valincr, Yvalue, Xvalue: double;
Title: string;
begin
if BlankFrm = nil then
Application.CreateForm(TBlankFrm, BlankFrm);
BlankFrm.Caption := PlotTitleEdit.Text;
BlankFrm.Show;
imagewide := BlankFrm.Image1.Width;
imagehi := BlankFrm.Image1.Height;
vtop := 40;
vbottom := round(imagehi) - 60;
vhi := vbottom - vtop;
hleft := 100;
hright := imagewide - 80;
hwide := hright - hleft;
// Draw chart border and background
BlankFrm.Image1.Canvas.Pen.Color := clBlack;
BlankFrm.Image1.Canvas.Brush.Color := clWhite;
BlankFrm.Image1.Canvas.Rectangle(0, 0, imagewide, imagehi);
// Draw title
Title := PlotTitleEdit.Text;
if Title <> '' then
begin
xpos := (imagewide - BlankFrm.Image1.Canvas.TextWidth(Title)) div 2;
yPos := 2;
BlankFrm.Image1.Canvas.TextOut(xpos, ypos, Title);
end;
// draw horizontal axis
BlankFrm.Image1.Canvas.Pen.Color := clBlack;
BlankFrm.Image1.Canvas.MoveTo(hleft,vbottom);
BlankFrm.Image1.Canvas.LineTo(hright,vbottom);
valincr := (maxX - minX) / 10.0;
for i := 1 to 11 do
begin
ypos := vbottom;
Xvalue := minX + valincr * (i - 1);
xpos := hleft + round(hwide * ((Xvalue - minX) / (maxX - minX)));
BlankFrm.Image1.Canvas.MoveTo(xpos,ypos);
ypos := ypos + 10;
BlankFrm.Image1.Canvas.LineTo(xpos,ypos);
Title := Format('%.2f', [Xvalue]);
offset := BlankFrm.Image1.Canvas.TextWidth(Title) div 2;
xpos := xpos - offset;
BlankFrm.Image1.Canvas.Pen.Color := clBlack;
BlankFrm.Image1.Canvas.TextOut(xpos, ypos, Title);
end;
xpos := hleft + (hwide - BlankFrm.Image1.Canvas.TextWidth(XEdit.Text)) div 2;
ypos := vbottom + 30;
BlankFrm.Image1.Canvas.TextOut(xpos, ypos, XEdit.Text);
// draw vertical axis
Title := 'Y VALUES';
xpos := hleft - BlankFrm.Image1.Canvas.TextWidth(Title) div 2;
ypos := 8;
BlankFrm.Image1.Canvas.TextOut(xpos, ypos, Title);
xpos := hleft;
ypos := vtop;
BlankFrm.Image1.Canvas.MoveTo(xpos, ypos);
ypos := vbottom;
BlankFrm.Image1.Canvas.LineTo(xpos, ypos);
valincr := (maxY - minY) / 10.0;
for i := 1 to 11 do
begin
Title := Format('%.2f',[maxY - ((i-1)*valincr)]);
strhi := BlankFrm.Image1.Canvas.TextHeight(Title);
xpos := hleft - 20 - BlankFrm.Image1.Canvas.TextWidth(Title);
Yvalue := maxY - (valincr * (i-1));
ypos := round(vhi * ( (maxY - Yvalue) / (maxY - minY)));
ypos := ypos + vtop - strhi div 2;
BlankFrm.Image1.Canvas.TextOut(xpos, ypos, Title);
xpos := hleft;
ypos := ypos + strhi div 2;
BlankFrm.Image1.Canvas.MoveTo(xpos,ypos);
xpos := hleft - 10;
BlankFrm.Image1.Canvas.LineTo(xpos,ypos);
end;
// draw points for x and y pairs
for j := 0 to NoY-1 do
begin
BlankFrm.Image1.Canvas.Brush.Style := bsSolid;
BlankFrm.Image1.Canvas.Brush.Color := DATA_COLORS[j mod Length(DATA_COLORS)];
BlankFrm.Image1.Canvas.Pen.Color := DATA_COLORS[j mod Length(DATA_COLORS)];
BlankFrm.Image1.Canvas.Font.Color := DATA_COLORS[j mod Length(DATA_COLORS)];
Title := Trim(OS3MainFrm.DataGrid.Cells[selected[j],0]);
for i := 0 to N-1 do
begin
ypos := vtop + round(vhi * ( (maxY - YValues[j, i]) / (maxY - minY)));
xpos := hleft + round(hwide * ( (XValues[i] - minX) / (maxX - minX)));
if xpos < hleft then xpos := hleft;
if i = 0 then
BlankFrm.Image1.Canvas.MoveTo(xpos, ypos);
if LinesBox.Checked then
BlankFrm.Image1.Canvas.LineTo(xpos, ypos);
BlankFrm.Image1.Canvas.Ellipse(xpos, ypos, xpos+5, ypos+5);
end;
strhi := BlankFrm.Image1.Canvas.TextHeight(Title);
BlankFrm.Image1.Canvas.Brush.Color := clWhite;
xpos := hwide + hleft;
BlankFrm.Image1.Canvas.MoveTo(xpos, ypos-strhi);
BlankFrm.Image1.Canvas.TextOut(xpos, ypos, Title);
end;
BlankFrm.Image1.Canvas.Font.Color := clBlack;
end;
{$ENDIF}
procedure TXvsMultYForm.UpdateBtnStates;
var
lSelected: Boolean;
begin
lSelected := AnySelected(VarList);
XInBtn.Enabled := lSelected and (XEdit.Text = '');
YInBtn.Enabled := lSelected;
xOutBtn.Enabled := (XEdit.Text <> '');
YOutBtn.Enabled := AnySelected(YBox);
end;
end. end.

View File

@@ -171,6 +171,9 @@ procedure TBasicSPCForm.FormCreate(Sender: TObject);
begin begin
Assert(OS3MainFrm <> nil); Assert(OS3MainFrm <> nil);
Width := Scale96ToFont(DEFAULT_WIDTH);
Height := Scale96ToFont(DEFAULT_HEIGHT);
FReportFrame := TReportFrame.Create(self); FReportFrame := TReportFrame.Create(self);
FReportFrame.Parent := ReportPage; FReportFrame.Parent := ReportPage;
FReportFrame.Align := alClient; FReportFrame.Align := alClient;

View File

@@ -95,6 +95,9 @@ const
CSV_FILE_FILTER = 'Comma field files (*.csv)|*.csv;*.CSV|Text files (*.txt)|*.txt;*.TXT|All files (*.*)|*.*'; CSV_FILE_FILTER = 'Comma field files (*.csv)|*.csv;*.CSV|Text files (*.txt)|*.txt;*.TXT|All files (*.*)|*.*';
SSV_FILE_FILTER = 'Space field files (*.ssv)|*.ssv;*.SSV|Text files (*.txt)|*.txt;*.TXT|All files (*.*)|*.*'; SSV_FILE_FILTER = 'Space field files (*.ssv)|*.ssv;*.SSV|Text files (*.txt)|*.txt;*.TXT|All files (*.*)|*.*';
DEFAULT_WIDTH = 1000;
DEFAULT_HEIGHT = 500;
implementation implementation
end. end.