TAChart: Move "Statistics" page from line demo to source demo

git-svn-id: trunk@32332 -
This commit is contained in:
ask 2011-09-14 11:22:00 +00:00
parent 22d381a9b0
commit 478be019bc
5 changed files with 237 additions and 205 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="9"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<Version Value="8"/>
<General> <General>
<Flags> <Flags>
<SaveClosedFiles Value="False"/> <SaveClosedFiles Value="False"/>
@ -10,12 +10,14 @@
</Flags> </Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/> <MainUnit Value="0"/>
<TargetFileExt Value=".exe"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>
</General> </General>
<VersionInfo> <VersionInfo>
<StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> <StringTable ProductVersion=""/>
</VersionInfo> </VersionInfo>
<BuildModes Count="1">
<Item1 Name="default" Default="True"/>
</BuildModes>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>
<IgnoreBinaries Value="False"/> <IgnoreBinaries Value="False"/>
@ -53,10 +55,10 @@
</Units> </Units>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
<Version Value="9"/> <Version Value="10"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<SearchPaths> <SearchPaths>
<IncludeFiles Value="$(ProjOutDir)\"/> <IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths> </SearchPaths>
<Parsing> <Parsing>

View File

@ -1,113 +1,192 @@
object Form1: TForm1 object Form1: TForm1
Left = 342 Left = 342
Height = 385 Height = 415
Top = 199 Top = 199
Width = 559 Width = 595
Caption = 'Form1' Caption = 'Form1'
ClientHeight = 385 ClientHeight = 415
ClientWidth = 559 ClientWidth = 595
LCLVersion = '0.9.29' LCLVersion = '0.9.31'
object Memo1: TMemo
Left = 0
Height = 48
Top = 0
Width = 559
Align = alTop
Lines.Strings = (
'Modify sources at design-time.'
'Same-colored series from each chart have common sources.'
)
TabOrder = 0
end
object Chart1: TChart
Left = 293
Height = 337
Top = 48
Width = 266
AxisList = <
item
Alignment = calLeft
Title.Font.Orientation = 900
Transformation.Offset = 0
Transformation.Scale = 1
end
item
Alignment = calBottom
Transformation.Offset = 0
Transformation.Scale = 1
end>
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue
Title.Brush.Color = clBtnFace
Title.Font.Color = clBlue
Title.Text.Strings = (
'TAChart'
)
Align = alRight
ParentColor = False
object Chart1BarSeries1: TBarSeries
BarBrush.Color = clRed
SeriesColor = clRed
Source = RandomChartSource1
end
object Chart1LineSeries1: TLineSeries
ZPosition = 1
LinePen.Color = clBlue
Pointer.Brush.Color = clBlue
SeriesColor = clBlue
ShowPoints = True
Source = ListChartSource1
end
end
object Chart2: TChart
Left = 0
Height = 337
Top = 48
Width = 288
AxisList = <
item
Alignment = calLeft
Title.Font.Orientation = 900
Transformation.Offset = 0
Transformation.Scale = 1
end
item
Alignment = calBottom
Transformation.Offset = 0
Transformation.Scale = 1
end>
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue
Title.Brush.Color = clBtnFace
Title.Font.Color = clBlue
Title.Text.Strings = (
'TAChart'
)
Align = alClient
ParentColor = False
object Chart2LineSeries1: TLineSeries
LinePen.Color = clRed
Pointer.Brush.Color = clRed
SeriesColor = clRed
ShowPoints = True
Source = RandomChartSource1
end
object Chart2AreaSeries1: TAreaSeries
AreaBrush.Color = clBlue
AreaLinesPen.Color = clMaroon
SeriesColor = clBlue
Source = ListChartSource1
end
end
object Splitter1: TSplitter object Splitter1: TSplitter
Left = 288 Left = 590
Height = 337 Height = 415
Top = 48 Top = 0
Width = 5 Width = 5
Align = alRight Align = alRight
Beveled = True Beveled = True
ResizeAnchor = akRight ResizeAnchor = akRight
end end
object PageControl1: TPageControl
Left = 0
Height = 415
Top = 0
Width = 590
ActivePage = tsBasic
Align = alClient
TabIndex = 0
TabOrder = 1
object tsBasic: TTabSheet
Caption = 'Basic'
ClientHeight = 389
ClientWidth = 582
object Memo1: TMemo
Left = 0
Height = 34
Top = 0
Width = 582
Align = alTop
Lines.Strings = (
'Modify sources at design-time.'
'Same-colored series from each chart have common sources.'
)
TabOrder = 0
end
object Chart2: TChart
Left = 0
Height = 355
Top = 34
Width = 291
AxisList = <
item
Minors = <>
Title.LabelFont.Orientation = 900
end
item
Alignment = calBottom
Minors = <>
end>
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue
Title.Brush.Color = clBtnFace
Title.Font.Color = clBlue
Title.Text.Strings = (
'TAChart'
)
Align = alClient
ParentColor = False
object Chart2LineSeries1: TLineSeries
LinePen.Color = clRed
Pointer.Brush.Color = clRed
ShowPoints = True
Source = RandomChartSource1
end
object Chart2AreaSeries1: TAreaSeries
AreaBrush.Color = clBlue
AreaLinesPen.Color = clMaroon
Source = ListChartSource1
end
end
object Chart1: TChart
Left = 291
Height = 355
Top = 34
Width = 291
AxisList = <
item
Minors = <>
Title.LabelFont.Orientation = 900
end
item
Alignment = calBottom
Minors = <>
end>
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue
Title.Brush.Color = clBtnFace
Title.Font.Color = clBlue
Title.Text.Strings = (
'TAChart'
)
Align = alRight
ParentColor = False
object Chart1BarSeries1: TBarSeries
BarBrush.Color = clRed
Source = RandomChartSource1
end
object Chart1LineSeries1: TLineSeries
ZPosition = 1
LinePen.Color = clBlue
Pointer.Brush.Color = clBlue
ShowPoints = True
Source = ListChartSource1
end
end
end
object tsStatistics: TTabSheet
Caption = 'Statistics'
ClientHeight = 389
ClientWidth = 582
object chCalc: TChart
Left = 0
Height = 355
Top = 0
Width = 582
AxisList = <
item
Minors = <>
Title.LabelFont.Orientation = 900
end
item
Alignment = calBottom
Minors = <>
end>
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue
Legend.Alignment = laTopLeft
Legend.MarginX = 40
Legend.MarginY = 10
Legend.UseSidebar = False
Legend.Visible = True
Title.Brush.Color = clBtnFace
Title.Font.Color = clBlue
Title.Text.Strings = (
'TAChart'
)
Align = alClient
ParentColor = False
object chCalcLineSeries1: TLineSeries
Title = 'Data'
LineType = ltNone
ShowPoints = True
Source = RandomChartSource2
end
object chCalcLineSeriesSum: TLineSeries
Title = 'Cumulative'
LinePen.Color = clMaroon
LinePen.Width = 2
Source = ccsSum
end
object chCalcLineSeriesAvg: TLineSeries
Title = 'Running average'
ZPosition = 1
LinePen.Color = clTeal
LinePen.Width = 2
Source = ccsAvg
end
end
object Panel2: TPanel
Left = 0
Height = 34
Top = 355
Width = 582
Align = alBottom
ClientHeight = 34
ClientWidth = 582
TabOrder = 1
object cbCumulative: TCheckBox
Left = 8
Height = 17
Top = 7
Width = 73
Caption = 'Cumulative'
Checked = True
OnChange = cbCumulativeChange
State = cbChecked
TabOrder = 0
end
end
end
end
object RandomChartSource1: TRandomChartSource object RandomChartSource1: TRandomChartSource
PointsNumber = 8 PointsNumber = 8
RandSeed = 624484796 RandSeed = 624484796
@ -120,13 +199,37 @@ object Form1: TForm1
end end
object ListChartSource1: TListChartSource object ListChartSource1: TListChartSource
DataPoints.Strings = ( DataPoints.Strings = (
'-3|2||' '-3|2|?|'
'-2|3||' '-2|3|?|'
'-1|4||' '-1|4|?|'
'0|1||' '0|1|?|'
'3|2||' '3|2|?|'
) )
left = 240 left = 240
top = 260 top = 260
end end
object ccsSum: TCalculatedChartSource
AccumulationMethod = camSum
AccumulationRange = 0
Origin = RandomChartSource2
left = 504
top = 112
end
object ccsAvg: TCalculatedChartSource
AccumulationMethod = camAverage
AccumulationRange = 5
Origin = RandomChartSource2
left = 504
top = 168
end
object RandomChartSource2: TRandomChartSource
PointsNumber = 25
RandSeed = 840176578
XMax = 20
XMin = -10
YMax = 8
YMin = 1
left = 504
top = 268
end
end end

View File

@ -5,23 +5,36 @@ unit Main;
interface interface
uses uses
ExtCtrls, StdCtrls, Forms, TAGraph, TASeries, TASources; ComCtrls, ExtCtrls, StdCtrls, Forms, TAGraph, TASeries, TASources, Classes;
type type
{ TForm1 } { TForm1 }
TForm1 = class(TForm) TForm1 = class(TForm)
cbCumulative: TCheckBox;
ccsAvg: TCalculatedChartSource;
ccsSum: TCalculatedChartSource;
Chart1: TChart; Chart1: TChart;
Chart1BarSeries1: TBarSeries; Chart1BarSeries1: TBarSeries;
Chart1LineSeries1: TLineSeries; Chart1LineSeries1: TLineSeries;
Chart2: TChart; Chart2: TChart;
Chart2AreaSeries1: TAreaSeries; Chart2AreaSeries1: TAreaSeries;
Chart2LineSeries1: TLineSeries; Chart2LineSeries1: TLineSeries;
chCalc: TChart;
chCalcLineSeries1: TLineSeries;
chCalcLineSeriesAvg: TLineSeries;
chCalcLineSeriesSum: TLineSeries;
ListChartSource1: TListChartSource; ListChartSource1: TListChartSource;
Memo1: TMemo; Memo1: TMemo;
PageControl1: TPageControl;
Panel2: TPanel;
RandomChartSource1: TRandomChartSource; RandomChartSource1: TRandomChartSource;
RandomChartSource2: TRandomChartSource;
Splitter1: TSplitter; Splitter1: TSplitter;
tsStatistics: TTabSheet;
tsBasic: TTabSheet;
procedure cbCumulativeChange(Sender: TObject);
end; end;
var var
@ -31,5 +44,12 @@ implementation
{$R *.lfm} {$R *.lfm}
{ TForm1 }
procedure TForm1.cbCumulativeChange(Sender: TObject);
begin
chCalcLineSeriesSum.Active := cbCumulative.Checked;
end;
end. end.

View File

@ -150,84 +150,6 @@ object Form1: TForm1
end end
end end
end end
object tsStats: TTabSheet
Caption = 'Statistics'
ClientHeight = 453
ClientWidth = 637
object chCalc: TChart
Left = 0
Height = 419
Top = 0
Width = 637
AxisList = <
item
Minors = <>
Title.LabelFont.Orientation = 900
end
item
Alignment = calBottom
Minors = <>
end>
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue
Legend.Alignment = laTopLeft
Legend.MarginX = 40
Legend.MarginY = 10
Legend.UseSidebar = False
Legend.Visible = True
Title.Brush.Color = clBtnFace
Title.Font.Color = clBlue
Title.Text.Strings = (
'TAChart'
)
Align = alClient
ParentColor = False
object chCalcLineSeries1: TLineSeries
Title = 'Data'
LineType = ltNone
ShowPoints = True
Source = RandomChartSource1
end
object chCalcLineSeriesSum: TLineSeries
Title = 'Cumulative'
LinePen.Color = clMaroon
LinePen.Width = 2
Source = ccsSum
end
object chCalcLineSeriesAvg: TLineSeries
Title = 'Running average'
ZPosition = 1
LinePen.Color = clTeal
LinePen.Width = 2
Source = ccsAvg
end
object chCalcLineSeriesDerivative: TLineSeries
Title = 'Derivative'
Source = ccsDerivative
end
end
object Panel2: TPanel
Left = 0
Height = 34
Top = 419
Width = 637
Align = alBottom
ClientHeight = 34
ClientWidth = 637
TabOrder = 1
object cbCumulative: TCheckBox
Left = 8
Height = 17
Top = 7
Width = 73
Caption = 'Cumulative'
Checked = True
OnChange = cbCumulativeChange
State = cbChecked
TabOrder = 0
end
end
end
object tsPointers: TTabSheet object tsPointers: TTabSheet
Caption = 'Pointers' Caption = 'Pointers'
ClientHeight = 453 ClientHeight = 453
@ -289,7 +211,7 @@ object Form1: TForm1
end end
object RandomChartSource1: TRandomChartSource object RandomChartSource1: TRandomChartSource
PointsNumber = 25 PointsNumber = 25
RandSeed = -840176578 RandSeed = 840176578
XMax = 20 XMax = 20
XMin = -10 XMin = -10
YMax = 8 YMax = 8
@ -328,7 +250,6 @@ object Form1: TForm1
end end
object ccsDerivative: TCalculatedChartSource object ccsDerivative: TCalculatedChartSource
AccumulationMethod = camDerivative AccumulationMethod = camDerivative
AccumulationRange = 2
Origin = RandomChartSource1 Origin = RandomChartSource1
left = 464 left = 464
top = 160 top = 160

View File

@ -22,13 +22,7 @@ type
ccsAvg: TCalculatedChartSource; ccsAvg: TCalculatedChartSource;
ccsDerivative: TCalculatedChartSource; ccsDerivative: TCalculatedChartSource;
ccsSum: TCalculatedChartSource; ccsSum: TCalculatedChartSource;
cbCumulative: TCheckBox;
chCalcLineSeriesDerivative: TLineSeries;
chPointers: TChart; chPointers: TChart;
chCalc: TChart;
chCalcLineSeries1: TLineSeries;
chCalcLineSeriesAvg: TLineSeries;
chCalcLineSeriesSum: TLineSeries;
chFast: TChart; chFast: TChart;
chFastConstantLine1: TConstantLine; chFastConstantLine1: TConstantLine;
chFastLineSeries1: TLineSeries; chFastLineSeries1: TLineSeries;
@ -41,17 +35,14 @@ type
lblPointsCount: TLabel; lblPointsCount: TLabel;
PageControl2: TPageControl; PageControl2: TPageControl;
Panel1: TPanel; Panel1: TPanel;
Panel2: TPanel;
pnlPointers: TPanel; pnlPointers: TPanel;
RandomChartSource1: TRandomChartSource; RandomChartSource1: TRandomChartSource;
sePointerSize: TSpinEdit; sePointerSize: TSpinEdit;
tsPointers: TTabSheet; tsPointers: TTabSheet;
tsStats: TTabSheet;
tsFast: TTabSheet; tsFast: TTabSheet;
procedure btnAddSeriesClick(Sender: TObject); procedure btnAddSeriesClick(Sender: TObject);
procedure btnRefreshClick(Sender: TObject); procedure btnRefreshClick(Sender: TObject);
procedure cb3DChange(Sender: TObject); procedure cb3DChange(Sender: TObject);
procedure cbCumulativeChange(Sender: TObject);
procedure cbLineTypeChange(Sender: TObject); procedure cbLineTypeChange(Sender: TObject);
procedure cbRotatedChange(Sender: TObject); procedure cbRotatedChange(Sender: TObject);
procedure cbSortedChange(Sender: TObject); procedure cbSortedChange(Sender: TObject);
@ -110,11 +101,6 @@ begin
ls.Depth := 15 - ls.Depth; ls.Depth := 15 - ls.Depth;
end; end;
procedure TForm1.cbCumulativeChange(Sender: TObject);
begin
chCalcLineSeriesSum.Active := cbCumulative.Checked;
end;
procedure TForm1.cbLineTypeChange(Sender: TObject); procedure TForm1.cbLineTypeChange(Sender: TObject);
var var
ls: TLineSeries; ls: TLineSeries;