TAChart: Display total points count in line demo

git-svn-id: trunk@29798 -
This commit is contained in:
ask 2011-03-11 11:46:22 +00:00
parent 26ac2c3d21
commit 3082fa3f2e
4 changed files with 47 additions and 39 deletions

View File

@ -1,18 +1,18 @@
object Form1: TForm1
Left = 703
Left = 647
Height = 479
Top = 364
Width = 589
Width = 645
Caption = 'Form1'
ClientHeight = 479
ClientWidth = 589
ClientWidth = 645
Position = poScreenCenter
LCLVersion = '0.9.31'
object PageControl2: TPageControl
Left = 0
Height = 479
Top = 0
Width = 589
Width = 645
ActivePage = tsFast
Align = alClient
TabIndex = 0
@ -20,12 +20,12 @@ object Form1: TForm1
object tsFast: TTabSheet
Caption = 'Fast drawing'
ClientHeight = 453
ClientWidth = 581
ClientWidth = 637
object chFast: TChart
Left = 0
Height = 411
Top = 42
Width = 581
Height = 415
Top = 38
Width = 637
AxisList = <
item
Title.LabelFont.Orientation = 900
@ -59,18 +59,18 @@ object Form1: TForm1
end
object Panel1: TPanel
Left = 0
Height = 42
Height = 38
Top = 0
Width = 581
Width = 637
Align = alTop
ClientHeight = 42
ClientWidth = 581
ClientHeight = 38
ClientWidth = 637
TabOrder = 1
object cbLineType: TComboBox
Left = 8
Height = 21
Top = 8
Width = 120
Width = 96
ItemHeight = 13
ItemIndex = 1
Items.Strings = (
@ -86,7 +86,7 @@ object Form1: TForm1
Text = 'Previous'
end
object cb3D: TCheckBox
Left = 136
Left = 112
Height = 17
Top = 12
Width = 33
@ -95,7 +95,7 @@ object Form1: TForm1
TabOrder = 1
end
object cbRotated: TCheckBox
Left = 176
Left = 152
Height = 17
Top = 12
Width = 59
@ -104,33 +104,33 @@ object Form1: TForm1
TabOrder = 2
end
object btnAddSeries: TButton
Left = 296
Left = 372
Height = 25
Top = 8
Width = 75
Caption = 'More series'
Top = 6
Width = 31
Caption = 'Add'
OnClick = btnAddSeriesClick
TabOrder = 3
end
object edTime: TEdit
Left = 468
Left = 496
Height = 21
Top = 8
Top = 6
Width = 76
Alignment = taRightJustify
TabOrder = 4
end
object btnRefresh: TButton
Left = 376
Left = 404
Height = 25
Top = 8
Top = 6
Width = 88
Caption = 'Timed refresh:'
OnClick = btnRefreshClick
TabOrder = 5
end
object cbSorted: TCheckBox
Left = 240
Left = 216
Height = 17
Top = 12
Width = 52
@ -138,12 +138,12 @@ object Form1: TForm1
OnChange = cbSortedChange
TabOrder = 6
end
object PageControl1: TPageControl
Left = 114
Height = 200
Top = 41
Width = 200
TabOrder = 7
object lblPointsCount: TLabel
Left = 282
Height = 1
Top = 14
Width = 1
ParentColor = False
end
end
end

View File

@ -15,16 +15,16 @@ type
TForm1 = class(TForm)
btnAddSeries: TButton;
btnRefresh: TButton;
ccsAvg: TCalculatedChartSource;
cb3D: TCheckBox;
cbLineType: TComboBox;
cbRotated: TCheckBox;
cbSorted: TCheckBox;
ccsAvg: TCalculatedChartSource;
ccsSum: TCalculatedChartSource;
chCalc: TChart;
chCalcLineSeries1: TLineSeries;
chCalcLineSeriesSum: TLineSeries;
chCalcLineSeriesAvg: TLineSeries;
chCalcLineSeriesSum: TLineSeries;
chFast: TChart;
chFastConstantLine1: TConstantLine;
chFastLineSeries1: TLineSeries;
@ -33,7 +33,7 @@ type
ChartToolset1PanDragTool1: TPanDragTool;
ChartToolset1ZoomDragTool1: TZoomDragTool;
edTime: TEdit;
PageControl1: TPageControl;
lblPointsCount: TLabel;
PageControl2: TPageControl;
Panel1: TPanel;
RandomChartSource1: TRandomChartSource;
@ -60,6 +60,8 @@ uses
{ TForm1 }
procedure TForm1.btnAddSeriesClick(Sender: TObject);
const
POINTS_PER_SERIE = 50000;
var
s: TLineSeries;
i, j: Integer;
@ -67,10 +69,12 @@ begin
for i := 1 to 10 do begin
s := TLineSeries.Create(chFast);
s.SeriesColor := clRed;
for j := 1 to 50000 do
for j := 1 to POINTS_PER_SERIE do
s.AddXY(j, Random * 5 + chFast.SeriesCount * 10);
chFast.AddSeries(s);
end;
lblPointsCount.Caption :=
Format('Points: %.2e', [chFast.SeriesCount * POINTS_PER_SERIE * 1.0]);
end;
procedure TForm1.btnRefreshClick(Sender: TObject);

View File

@ -29,14 +29,18 @@
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<RequiredPackages Count="3">
<Item1>
<PackageName Value="TAChartLazarusPkg"/>
<MinVersion Major="1" Valid="True"/>
<PackageName Value="LCLBase"/>
<MinVersion Major="1" Release="1" Valid="True"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
<PackageName Value="TAChartLazarusPkg"/>
<MinVersion Major="1" Valid="True"/>
</Item2>
<Item3>
<PackageName Value="LCL"/>
</Item3>
</RequiredPackages>
<Units Count="2">
<Unit0>

View File

@ -51,9 +51,9 @@ type
procedure TestExpandRect;
procedure TestLineIntersectsLine;
procedure TestLineIntersectsRect;
procedure TestPointInPolygon;
procedure TestPointOnLine;
procedure TestPointOperations;
procedure TestPointInPolygon;
procedure TestPolygonIntersectsPolygon;
end;