TAChart: Use random source in demos.

git-svn-id: trunk@20159 -
This commit is contained in:
ask 2009-05-24 07:18:18 +00:00
parent 28d862e408
commit 2f19160d24
6 changed files with 93 additions and 65 deletions

View File

@ -6,7 +6,6 @@ object Form1: TForm1
Caption = 'Form1' Caption = 'Form1'
ClientHeight = 300 ClientHeight = 300
ClientWidth = 560 ClientWidth = 560
OnCreate = FormCreate
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '0.9.27' LCLVersion = '0.9.27'
object Chart1: TChart object Chart1: TChart
@ -33,6 +32,7 @@ object Form1: TForm1
BarWidthPercent = 50 BarWidthPercent = 50
Depth = 10 Depth = 10
SeriesColor = clTeal SeriesColor = clTeal
Source = RandomChartSource1
end end
object Chart1BarSeries2: TBarSeries object Chart1BarSeries2: TBarSeries
ZPosition = 30 ZPosition = 30
@ -40,11 +40,33 @@ object Form1: TForm1
BarWidthPercent = 50 BarWidthPercent = 50
Depth = 10 Depth = 10
SeriesColor = clMaroon SeriesColor = clMaroon
Source = RandomChartSource2
end end
object Chart1LineSeries1: TLineSeries object Chart1LineSeries1: TLineSeries
ZPosition = 50 ZPosition = 50
Depth = 10 Depth = 10
SeriesColor = clBlue SeriesColor = clBlue
Source = RandomChartSource1
end end
end end
object RandomChartSource1: TRandomChartSource
PointsNumber = 7
RandSeed = 545516281
XMax = 7
XMin = 1
YMax = 12
YMin = 4
left = 120
top = 52
end
object RandomChartSource2: TRandomChartSource
PointsNumber = 7
RandSeed = 87568756
XMax = 7
XMin = 1
YMax = 12
YMin = 1
left = 120
top = 100
end
end end

View File

@ -3,17 +3,25 @@
LazarusResources.Add('TForm1','FORMDATA',[ LazarusResources.Add('TForm1','FORMDATA',[
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'>'#1#6'Height'#3','#1#3'Top'#3#150#0#5'Wi' 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'>'#1#6'Height'#3','#1#3'Top'#3#150#0#5'Wi'
+'dth'#3'0'#2#7'Caption'#6#5'Form1'#12'ClientHeight'#3','#1#11'ClientWidth'#3 +'dth'#3'0'#2#7'Caption'#6#5'Form1'#12'ClientHeight'#3','#1#11'ClientWidth'#3
+'0'#2#8'OnCreate'#7#10'FormCreate'#8'Position'#7#14'poScreenCenter'#10'LCLVe' +'0'#2#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.27'#0#6'TChart'
+'rsion'#6#6'0.9.27'#0#6'TChart'#6'Chart1'#4'Left'#2#0#6'Height'#3','#1#3'Top' +#6'Chart1'#4'Left'#2#0#6'Height'#3','#1#3'Top'#2#0#5'Width'#3'0'#2#21'Bottom'
+#2#0#5'Width'#3'0'#2#21'BottomAxis.Grid.Style'#7#5'psDot'#5'Depth'#2'2'#16'F' +'Axis.Grid.Style'#7#5'psDot'#5'Depth'#2'2'#16'Foot.Brush.Color'#7#9'clBtnFac'
+'oot.Brush.Color'#7#9'clBtnFace'#15'Foot.Font.Color'#7#6'clBlue'#19'LeftAxis' +'e'#15'Foot.Font.Color'#7#6'clBlue'#19'LeftAxis.Grid.Style'#7#5'psDot'#20'Le'
+'.Grid.Style'#7#5'psDot'#20'LeftAxis.Title.Angle'#2'Z'#17'Title.Brush.Color' +'ftAxis.Title.Angle'#2'Z'#17'Title.Brush.Color'#7#9'clBtnFace'#16'Title.Font'
+#7#9'clBtnFace'#16'Title.Font.Color'#7#6'clBlue'#18'Title.Text.Strings'#1#6#7 +'.Color'#7#6'clBlue'#18'Title.Text.Strings'#1#6#7'TAChart'#0#5'Align'#7#8'al'
+'TAChart'#0#5'Align'#7#8'alClient'#11'ParentColor'#8#0#10'TBarSeries'#16'Cha' +'Client'#11'ParentColor'#8#0#10'TBarSeries'#16'Chart1BarSeries1'#9'ZPosition'
+'rt1BarSeries1'#9'ZPosition'#2#10#14'BarBrush.Color'#7#6'clTeal'#15'BarWidth' +#2#10#14'BarBrush.Color'#7#6'clTeal'#15'BarWidthPercent'#2'2'#5'Depth'#2#10
+'Percent'#2'2'#5'Depth'#2#10#11'SeriesColor'#7#6'clTeal'#0#0#10'TBarSeries' +#11'SeriesColor'#7#6'clTeal'#6'Source'#7#18'RandomChartSource1'#0#0#10'TBarS'
+#16'Chart1BarSeries2'#9'ZPosition'#2#30#14'BarBrush.Color'#7#8'clMaroon'#15 +'eries'#16'Chart1BarSeries2'#9'ZPosition'#2#30#14'BarBrush.Color'#7#8'clMaro'
+'BarWidthPercent'#2'2'#5'Depth'#2#10#11'SeriesColor'#7#8'clMaroon'#0#0#11'TL' +'on'#15'BarWidthPercent'#2'2'#5'Depth'#2#10#11'SeriesColor'#7#8'clMaroon'#6
+'ineSeries'#17'Chart1LineSeries1'#9'ZPosition'#2'2'#5'Depth'#2#10#11'SeriesC' +'Source'#7#18'RandomChartSource2'#0#0#11'TLineSeries'#17'Chart1LineSeries1'#9
+'olor'#7#6'clBlue'#0#0#0#0 +'ZPosition'#2'2'#5'Depth'#2#10#11'SeriesColor'#7#6'clBlue'#6'Source'#7#18'Ra'
+'ndomChartSource1'#0#0#0#18'TRandomChartSource'#18'RandomChartSource1'#12'Po'
+'intsNumber'#2#7#8'RandSeed'#4#249#234#131' '#4'XMax'#5#0#0#0#0#0#0#0#224#1
+'@'#4'XMin'#5#0#0#0#0#0#0#0#128#255'?'#4'YMax'#5#0#0#0#0#0#0#0#192#2'@'#4'YM'
+'in'#5#0#0#0#0#0#0#0#128#1'@'#4'left'#2'x'#3'top'#2'4'#0#0#18'TRandomChartSo'
+'urce'#18'RandomChartSource2'#12'PointsNumber'#2#7#8'RandSeed'#4't18'#5#4'XM'
+'ax'#5#0#0#0#0#0#0#0#224#1'@'#4'XMin'#5#0#0#0#0#0#0#0#128#255'?'#4'YMax'#5#0
+#0#0#0#0#0#0#192#2'@'#4'YMin'#5#0#0#0#0#0#0#0#128#255'?'#4'left'#2'x'#3'top'
+#2'd'#0#0#0
]); ]);

View File

@ -6,7 +6,7 @@ interface
uses uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
TAGraph, TASeries; TAGraph, TASeries, TASources;
type type
@ -17,7 +17,8 @@ type
Chart1BarSeries1: TBarSeries; Chart1BarSeries1: TBarSeries;
Chart1BarSeries2: TBarSeries; Chart1BarSeries2: TBarSeries;
Chart1LineSeries1: TLineSeries; Chart1LineSeries1: TLineSeries;
procedure FormCreate(Sender: TObject); RandomChartSource1: TRandomChartSource;
RandomChartSource2: TRandomChartSource;
end; end;
var var
@ -25,20 +26,6 @@ var
implementation implementation
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
RandSeed := 876234;
for i := 1 to 7 do begin
Chart1BarSeries1.AddXY(i, Random(8) + 4);
Chart1BarSeries2.AddXY(i, Random(8) + 4);
Chart1LineSeries1.AddXY(i, Random(8) + 4);
end;
end;
initialization initialization
{$I main.lrs} {$I main.lrs}

View File

@ -36,6 +36,7 @@ object Form1: TForm1
Pointer.Pen.Color = clRed Pointer.Pen.Color = clRed
SeriesColor = clRed SeriesColor = clRed
ShowPoints = True ShowPoints = True
Source = RandomChartSource1
end end
object clRight: TLine object clRight: TLine
LineStyle = lsVertical LineStyle = lsVertical
@ -126,4 +127,14 @@ object Form1: TForm1
Value = 1.7 Value = 1.7
end end
end end
object RandomChartSource1: TRandomChartSource
PointsNumber = 20
RandSeed = 628509515
XMax = 5
XMin = -5
YMax = 5
YMin = -5
left = 176
top = 118
end
end end

View File

@ -14,33 +14,37 @@ LazarusResources.Add('TForm1','FORMDATA',[
+'rush.Color'#7#9'clBtnFace'#16'Title.Font.Color'#7#6'clBlue'#18'Title.Text.S' +'rush.Color'#7#9'clBtnFace'#16'Title.Font.Color'#7#6'clBlue'#18'Title.Text.S'
+'trings'#1#6#7'TAChart'#0#5'Align'#7#8'alClient'#11'ParentColor'#8#0#11'TLin' +'trings'#1#6#7'TAChart'#0#5'Align'#7#8'alClient'#11'ParentColor'#8#0#11'TLin'
+'eSeries'#16'Chart1LineSeries'#19'Pointer.Brush.Color'#7#5'clRed'#17'Pointer' +'eSeries'#16'Chart1LineSeries'#19'Pointer.Brush.Color'#7#5'clRed'#17'Pointer'
+'.Pen.Color'#7#5'clRed'#11'SeriesColor'#7#5'clRed'#10'ShowPoints'#9#0#0#5'TL' +'.Pen.Color'#7#5'clRed'#11'SeriesColor'#7#5'clRed'#10'ShowPoints'#9#6'Source'
+'ine'#7'clRight'#9'LineStyle'#7#10'lsVertical'#9'Pen.Color'#7#7'clGreen'#9'P' +#7#18'RandomChartSource1'#0#0#5'TLine'#7'clRight'#9'LineStyle'#7#10'lsVertic'
+'en.Style'#7#5'psDot'#8'Position'#5#0#152#153#153#153#153#153#217#255'?'#11 +'al'#9'Pen.Color'#7#7'clGreen'#9'Pen.Style'#7#5'psDot'#8'Position'#5#0#152
+'SeriesColor'#7#7'clGreen'#9'UseBounds'#8#0#0#5'TLine'#6'clLeft'#9'LineStyle' +#153#153#153#153#153#217#255'?'#11'SeriesColor'#7#7'clGreen'#9'UseBounds'#8#0
+#7#10'lsVertical'#9'Pen.Color'#7#7'clGreen'#9'Pen.Style'#7#5'psDot'#8'Positi' +#0#5'TLine'#6'clLeft'#9'LineStyle'#7#10'lsVertical'#9'Pen.Color'#7#7'clGreen'
+'on'#5#0#152#153#153#153#153#153#217#255#191#11'SeriesColor'#7#7'clGreen'#9 +#9'Pen.Style'#7#5'psDot'#8'Position'#5#0#152#153#153#153#153#153#217#255#191
+'UseBounds'#8#0#0#5'TLine'#5'clTop'#9'Pen.Color'#7#7'clGreen'#9'Pen.Style'#7 +#11'SeriesColor'#7#7'clGreen'#9'UseBounds'#8#0#0#5'TLine'#5'clTop'#9'Pen.Col'
+#5'psDot'#8'Position'#5#0#152#153#153#153#153#153#217#255'?'#11'SeriesColor' +'or'#7#7'clGreen'#9'Pen.Style'#7#5'psDot'#8'Position'#5#0#152#153#153#153#153
+#7#7'clGreen'#9'UseBounds'#8#0#0#5'TLine'#8'clBottom'#9'Pen.Color'#7#7'clGre' +#153#217#255'?'#11'SeriesColor'#7#7'clGreen'#9'UseBounds'#8#0#0#5'TLine'#8'c'
+'en'#9'Pen.Style'#7#5'psDot'#8'Position'#5#0#152#153#153#153#153#153#217#255 +'lBottom'#9'Pen.Color'#7#7'clGreen'#9'Pen.Style'#7#5'psDot'#8'Position'#5#0
+#191#11'SeriesColor'#7#7'clGreen'#9'UseBounds'#8#0#0#0#6'TPanel'#6'Panel1'#4 +#152#153#153#153#153#153#217#255#191#11'SeriesColor'#7#7'clGreen'#9'UseBound'
+'Left'#2#0#6'Height'#2'Z'#3'Top'#3'3'#1#5'Width'#3#140#1#5'Align'#7#8'alBott' +'s'#8#0#0#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6'Height'#2'Z'#3'Top'#3'3'#1#5'W'
+'om'#12'ClientHeight'#2'Z'#11'ClientWidth'#3#140#1#8'TabOrder'#2#1#0#6'TLabe' +'idth'#3#140#1#5'Align'#7#8'alBottom'#12'ClientHeight'#2'Z'#11'ClientWidth'#3
+'l'#13'lblBoundValue'#4'Left'#3#160#0#6'Height'#2#14#3'Top'#2#21#5'Width'#2 +#140#1#8'TabOrder'#2#1#0#6'TLabel'#13'lblBoundValue'#4'Left'#3#160#0#6'Heigh'
+#27#7'Caption'#6#5'Value'#11'ParentColor'#8#0#0#11'TCheckGroup'#11'cgUseBoun' +'t'#2#14#3'Top'#2#21#5'Width'#2#27#7'Caption'#6#5'Value'#11'ParentColor'#8#0
+'ds'#4'Left'#2#1#6'Height'#2'X'#3'Top'#2#1#5'Width'#3#147#0#5'Align'#7#6'alL' +#0#11'TCheckGroup'#11'cgUseBounds'#4'Left'#2#1#6'Height'#2'X'#3'Top'#2#1#5'W'
+'eft'#8'AutoFill'#9#7'Caption'#6#12' Use bounds '#28'ChildSizing.LeftRightSp' +'idth'#3#147#0#5'Align'#7#6'alLeft'#8'AutoFill'#9#7'Caption'#6#12' Use bound'
+'acing'#2#8#28'ChildSizing.TopBottomSpacing'#2#6#29'ChildSizing.EnlargeHoriz' +'s '#28'ChildSizing.LeftRightSpacing'#2#8#28'ChildSizing.TopBottomSpacing'#2
+'ontal'#7#24'crsHomogenousChildResize'#27'ChildSizing.EnlargeVertical'#7#24 +#6#29'ChildSizing.EnlargeHorizontal'#7#24'crsHomogenousChildResize'#27'Child'
+'crsHomogenousChildResize'#28'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChi' +'Sizing.EnlargeVertical'#7#24'crsHomogenousChildResize'#28'ChildSizing.Shrin'
+'lds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.Lay' +'kHorizontal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsSc'
+'out'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.ControlsPerLine'#2#1 +'aleChilds'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'Ch'
+#13'Items.Strings'#1#6#4'Left'#6#5'Right'#6#6'Bottom'#6#3'Top'#0#11'OnItemCl' +'ildSizing.ControlsPerLine'#2#1#13'Items.Strings'#1#6#4'Left'#6#5'Right'#6#6
+'ick'#7#20'cgUseBoundsItemClick'#8'TabOrder'#2#0#4'Data'#10#8#0#0#0#4#0#0#0#2 +'Bottom'#6#3'Top'#0#11'OnItemClick'#7#20'cgUseBoundsItemClick'#8'TabOrder'#2
+#2#2#2#0#0#14'TFloatSpinEdit'#9'fseBounds'#4'Left'#3#204#0#6'Height'#2#23#3 +#0#4'Data'#10#8#0#0#0#4#0#0#0#2#2#2#2#0#0#14'TFloatSpinEdit'#9'fseBounds'#4
+'Top'#2#17#5'Width'#2'2'#9'Increment'#5#0#208#204#204#204#204#204#204#251'?' +'Left'#3#204#0#6'Height'#2#23#3'Top'#2#17#5'Width'#2'2'#9'Increment'#5#0#208
+#8'MaxValue'#5#0#0#0#0#0#0#0#160#2'@'#8'MinValue'#5#0#0#0#0#0#0#0#128#255'?' +#204#204#204#204#204#204#251'?'#8'MaxValue'#5#0#0#0#0#0#0#0#160#2'@'#8'MinVa'
+#8'OnChange'#7#15'fseBoundsChange'#8'TabOrder'#2#1#5'Value'#5#0#152#153#153 +'lue'#5#0#0#0#0#0#0#0#128#255'?'#8'OnChange'#7#15'fseBoundsChange'#8'TabOrde'
+#153#153#153#217#255'?'#0#0#0#0 +'r'#2#1#5'Value'#5#0#152#153#153#153#153#153#217#255'?'#0#0#0#18'TRandomChar'
+'tSource'#18'RandomChartSource1'#12'PointsNumber'#2#20#8'RandSeed'#4'KKv%'#4
+'XMax'#5#0#0#0#0#0#0#0#160#1'@'#4'XMin'#5#0#0#0#0#0#0#0#160#1#192#4'YMax'#5#0
+#0#0#0#0#0#0#160#1'@'#4'YMin'#5#0#0#0#0#0#0#0#160#1#192#4'left'#3#176#0#3'to'
+'p'#2'v'#0#0#0
]); ]);

View File

@ -6,7 +6,7 @@ interface
uses uses
Classes, ExtCtrls, Spin, StdCtrls, SysUtils, FileUtil, LResources, Forms, Classes, ExtCtrls, Spin, StdCtrls, SysUtils, FileUtil, LResources, Forms,
Controls, Graphics, Dialogs, TAGraph, TASeries; Controls, Graphics, Dialogs, TAGraph, TASeries, TASources;
type type
@ -23,6 +23,7 @@ type
fseBounds: TFloatSpinEdit; fseBounds: TFloatSpinEdit;
lblBoundValue: TLabel; lblBoundValue: TLabel;
Panel1: TPanel; Panel1: TPanel;
RandomChartSource1: TRandomChartSource;
procedure cgUseBoundsItemClick(Sender: TObject; Index: integer); procedure cgUseBoundsItemClick(Sender: TObject; Index: integer);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure fseBoundsChange(Sender: TObject); procedure fseBoundsChange(Sender: TObject);
@ -46,12 +47,7 @@ begin
end; end;
procedure TForm1.FormCreate(Sender: TObject); procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin begin
RandSeed := 342432;
for i := -10 to 10 do
Chart1LineSeries.AddXY(i * 0.5, Random(20) * 0.5 - 5);
fseBoundsChange(nil); fseBoundsChange(nil);
end; end;