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

View File

@ -1,113 +1,192 @@
object Form1: TForm1
Left = 342
Height = 385
Height = 415
Top = 199
Width = 559
Width = 595
Caption = 'Form1'
ClientHeight = 385
ClientWidth = 559
LCLVersion = '0.9.29'
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
ClientHeight = 415
ClientWidth = 595
LCLVersion = '0.9.31'
object Splitter1: TSplitter
Left = 288
Height = 337
Top = 48
Left = 590
Height = 415
Top = 0
Width = 5
Align = alRight
Beveled = True
ResizeAnchor = akRight
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
PointsNumber = 8
RandSeed = 624484796
@ -120,13 +199,37 @@ object Form1: TForm1
end
object ListChartSource1: TListChartSource
DataPoints.Strings = (
'-3|2||'
'-2|3||'
'-1|4||'
'0|1||'
'3|2||'
'-3|2|?|'
'-2|3|?|'
'-1|4|?|'
'0|1|?|'
'3|2|?|'
)
left = 240
top = 260
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

View File

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

View File

@ -150,84 +150,6 @@ object Form1: TForm1
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
Caption = 'Pointers'
ClientHeight = 453
@ -289,7 +211,7 @@ object Form1: TForm1
end
object RandomChartSource1: TRandomChartSource
PointsNumber = 25
RandSeed = -840176578
RandSeed = 840176578
XMax = 20
XMin = -10
YMax = 8
@ -328,7 +250,6 @@ object Form1: TForm1
end
object ccsDerivative: TCalculatedChartSource
AccumulationMethod = camDerivative
AccumulationRange = 2
Origin = RandomChartSource1
left = 464
top = 160

View File

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