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'
ClientHeight = 300
ClientWidth = 560
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '0.9.27'
object Chart1: TChart
@ -33,6 +32,7 @@ object Form1: TForm1
BarWidthPercent = 50
Depth = 10
SeriesColor = clTeal
Source = RandomChartSource1
end
object Chart1BarSeries2: TBarSeries
ZPosition = 30
@ -40,11 +40,33 @@ object Form1: TForm1
BarWidthPercent = 50
Depth = 10
SeriesColor = clMaroon
Source = RandomChartSource2
end
object Chart1LineSeries1: TLineSeries
ZPosition = 50
Depth = 10
SeriesColor = clBlue
Source = RandomChartSource1
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

View File

@ -3,17 +3,25 @@
LazarusResources.Add('TForm1','FORMDATA',[
'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
+'0'#2#8'OnCreate'#7#10'FormCreate'#8'Position'#7#14'poScreenCenter'#10'LCLVe'
+'rsion'#6#6'0.9.27'#0#6'TChart'#6'Chart1'#4'Left'#2#0#6'Height'#3','#1#3'Top'
+#2#0#5'Width'#3'0'#2#21'BottomAxis.Grid.Style'#7#5'psDot'#5'Depth'#2'2'#16'F'
+'oot.Brush.Color'#7#9'clBtnFace'#15'Foot.Font.Color'#7#6'clBlue'#19'LeftAxis'
+'.Grid.Style'#7#5'psDot'#20'LeftAxis.Title.Angle'#2'Z'#17'Title.Brush.Color'
+#7#9'clBtnFace'#16'Title.Font.Color'#7#6'clBlue'#18'Title.Text.Strings'#1#6#7
+'TAChart'#0#5'Align'#7#8'alClient'#11'ParentColor'#8#0#10'TBarSeries'#16'Cha'
+'rt1BarSeries1'#9'ZPosition'#2#10#14'BarBrush.Color'#7#6'clTeal'#15'BarWidth'
+'Percent'#2'2'#5'Depth'#2#10#11'SeriesColor'#7#6'clTeal'#0#0#10'TBarSeries'
+#16'Chart1BarSeries2'#9'ZPosition'#2#30#14'BarBrush.Color'#7#8'clMaroon'#15
+'BarWidthPercent'#2'2'#5'Depth'#2#10#11'SeriesColor'#7#8'clMaroon'#0#0#11'TL'
+'ineSeries'#17'Chart1LineSeries1'#9'ZPosition'#2'2'#5'Depth'#2#10#11'SeriesC'
+'olor'#7#6'clBlue'#0#0#0#0
+'0'#2#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.27'#0#6'TChart'
+#6'Chart1'#4'Left'#2#0#6'Height'#3','#1#3'Top'#2#0#5'Width'#3'0'#2#21'Bottom'
+'Axis.Grid.Style'#7#5'psDot'#5'Depth'#2'2'#16'Foot.Brush.Color'#7#9'clBtnFac'
+'e'#15'Foot.Font.Color'#7#6'clBlue'#19'LeftAxis.Grid.Style'#7#5'psDot'#20'Le'
+'ftAxis.Title.Angle'#2'Z'#17'Title.Brush.Color'#7#9'clBtnFace'#16'Title.Font'
+'.Color'#7#6'clBlue'#18'Title.Text.Strings'#1#6#7'TAChart'#0#5'Align'#7#8'al'
+'Client'#11'ParentColor'#8#0#10'TBarSeries'#16'Chart1BarSeries1'#9'ZPosition'
+#2#10#14'BarBrush.Color'#7#6'clTeal'#15'BarWidthPercent'#2'2'#5'Depth'#2#10
+#11'SeriesColor'#7#6'clTeal'#6'Source'#7#18'RandomChartSource1'#0#0#10'TBarS'
+'eries'#16'Chart1BarSeries2'#9'ZPosition'#2#30#14'BarBrush.Color'#7#8'clMaro'
+'on'#15'BarWidthPercent'#2'2'#5'Depth'#2#10#11'SeriesColor'#7#8'clMaroon'#6
+'Source'#7#18'RandomChartSource2'#0#0#11'TLineSeries'#17'Chart1LineSeries1'#9
+'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
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
TAGraph, TASeries;
TAGraph, TASeries, TASources;
type
@ -17,7 +17,8 @@ type
Chart1BarSeries1: TBarSeries;
Chart1BarSeries2: TBarSeries;
Chart1LineSeries1: TLineSeries;
procedure FormCreate(Sender: TObject);
RandomChartSource1: TRandomChartSource;
RandomChartSource2: TRandomChartSource;
end;
var
@ -25,20 +26,6 @@ var
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
{$I main.lrs}

View File

@ -36,6 +36,7 @@ object Form1: TForm1
Pointer.Pen.Color = clRed
SeriesColor = clRed
ShowPoints = True
Source = RandomChartSource1
end
object clRight: TLine
LineStyle = lsVertical
@ -126,4 +127,14 @@ object Form1: TForm1
Value = 1.7
end
end
object RandomChartSource1: TRandomChartSource
PointsNumber = 20
RandSeed = 628509515
XMax = 5
XMin = -5
YMax = 5
YMin = -5
left = 176
top = 118
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'
+'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'
+'.Pen.Color'#7#5'clRed'#11'SeriesColor'#7#5'clRed'#10'ShowPoints'#9#0#0#5'TL'
+'ine'#7'clRight'#9'LineStyle'#7#10'lsVertical'#9'Pen.Color'#7#7'clGreen'#9'P'
+'en.Style'#7#5'psDot'#8'Position'#5#0#152#153#153#153#153#153#217#255'?'#11
+'SeriesColor'#7#7'clGreen'#9'UseBounds'#8#0#0#5'TLine'#6'clLeft'#9'LineStyle'
+#7#10'lsVertical'#9'Pen.Color'#7#7'clGreen'#9'Pen.Style'#7#5'psDot'#8'Positi'
+'on'#5#0#152#153#153#153#153#153#217#255#191#11'SeriesColor'#7#7'clGreen'#9
+'UseBounds'#8#0#0#5'TLine'#5'clTop'#9'Pen.Color'#7#7'clGreen'#9'Pen.Style'#7
+#5'psDot'#8'Position'#5#0#152#153#153#153#153#153#217#255'?'#11'SeriesColor'
+#7#7'clGreen'#9'UseBounds'#8#0#0#5'TLine'#8'clBottom'#9'Pen.Color'#7#7'clGre'
+'en'#9'Pen.Style'#7#5'psDot'#8'Position'#5#0#152#153#153#153#153#153#217#255
+#191#11'SeriesColor'#7#7'clGreen'#9'UseBounds'#8#0#0#0#6'TPanel'#6'Panel1'#4
+'Left'#2#0#6'Height'#2'Z'#3'Top'#3'3'#1#5'Width'#3#140#1#5'Align'#7#8'alBott'
+'om'#12'ClientHeight'#2'Z'#11'ClientWidth'#3#140#1#8'TabOrder'#2#1#0#6'TLabe'
+'l'#13'lblBoundValue'#4'Left'#3#160#0#6'Height'#2#14#3'Top'#2#21#5'Width'#2
+#27#7'Caption'#6#5'Value'#11'ParentColor'#8#0#0#11'TCheckGroup'#11'cgUseBoun'
+'ds'#4'Left'#2#1#6'Height'#2'X'#3'Top'#2#1#5'Width'#3#147#0#5'Align'#7#6'alL'
+'eft'#8'AutoFill'#9#7'Caption'#6#12' Use bounds '#28'ChildSizing.LeftRightSp'
+'acing'#2#8#28'ChildSizing.TopBottomSpacing'#2#6#29'ChildSizing.EnlargeHoriz'
+'ontal'#7#24'crsHomogenousChildResize'#27'ChildSizing.EnlargeVertical'#7#24
+'crsHomogenousChildResize'#28'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChi'
+'lds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.Lay'
+'out'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.ControlsPerLine'#2#1
+#13'Items.Strings'#1#6#4'Left'#6#5'Right'#6#6'Bottom'#6#3'Top'#0#11'OnItemCl'
+'ick'#7#20'cgUseBoundsItemClick'#8'TabOrder'#2#0#4'Data'#10#8#0#0#0#4#0#0#0#2
+#2#2#2#0#0#14'TFloatSpinEdit'#9'fseBounds'#4'Left'#3#204#0#6'Height'#2#23#3
+'Top'#2#17#5'Width'#2'2'#9'Increment'#5#0#208#204#204#204#204#204#204#251'?'
+#8'MaxValue'#5#0#0#0#0#0#0#0#160#2'@'#8'MinValue'#5#0#0#0#0#0#0#0#128#255'?'
+#8'OnChange'#7#15'fseBoundsChange'#8'TabOrder'#2#1#5'Value'#5#0#152#153#153
+#153#153#153#217#255'?'#0#0#0#0
+'.Pen.Color'#7#5'clRed'#11'SeriesColor'#7#5'clRed'#10'ShowPoints'#9#6'Source'
+#7#18'RandomChartSource1'#0#0#5'TLine'#7'clRight'#9'LineStyle'#7#10'lsVertic'
+'al'#9'Pen.Color'#7#7'clGreen'#9'Pen.Style'#7#5'psDot'#8'Position'#5#0#152
+#153#153#153#153#153#217#255'?'#11'SeriesColor'#7#7'clGreen'#9'UseBounds'#8#0
+#0#5'TLine'#6'clLeft'#9'LineStyle'#7#10'lsVertical'#9'Pen.Color'#7#7'clGreen'
+#9'Pen.Style'#7#5'psDot'#8'Position'#5#0#152#153#153#153#153#153#217#255#191
+#11'SeriesColor'#7#7'clGreen'#9'UseBounds'#8#0#0#5'TLine'#5'clTop'#9'Pen.Col'
+'or'#7#7'clGreen'#9'Pen.Style'#7#5'psDot'#8'Position'#5#0#152#153#153#153#153
+#153#217#255'?'#11'SeriesColor'#7#7'clGreen'#9'UseBounds'#8#0#0#5'TLine'#8'c'
+'lBottom'#9'Pen.Color'#7#7'clGreen'#9'Pen.Style'#7#5'psDot'#8'Position'#5#0
+#152#153#153#153#153#153#217#255#191#11'SeriesColor'#7#7'clGreen'#9'UseBound'
+'s'#8#0#0#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6'Height'#2'Z'#3'Top'#3'3'#1#5'W'
+'idth'#3#140#1#5'Align'#7#8'alBottom'#12'ClientHeight'#2'Z'#11'ClientWidth'#3
+#140#1#8'TabOrder'#2#1#0#6'TLabel'#13'lblBoundValue'#4'Left'#3#160#0#6'Heigh'
+'t'#2#14#3'Top'#2#21#5'Width'#2#27#7'Caption'#6#5'Value'#11'ParentColor'#8#0
+#0#11'TCheckGroup'#11'cgUseBounds'#4'Left'#2#1#6'Height'#2'X'#3'Top'#2#1#5'W'
+'idth'#3#147#0#5'Align'#7#6'alLeft'#8'AutoFill'#9#7'Caption'#6#12' Use bound'
+'s '#28'ChildSizing.LeftRightSpacing'#2#8#28'ChildSizing.TopBottomSpacing'#2
+#6#29'ChildSizing.EnlargeHorizontal'#7#24'crsHomogenousChildResize'#27'Child'
+'Sizing.EnlargeVertical'#7#24'crsHomogenousChildResize'#28'ChildSizing.Shrin'
+'kHorizontal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsSc'
+'aleChilds'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'Ch'
+'ildSizing.ControlsPerLine'#2#1#13'Items.Strings'#1#6#4'Left'#6#5'Right'#6#6
+'Bottom'#6#3'Top'#0#11'OnItemClick'#7#20'cgUseBoundsItemClick'#8'TabOrder'#2
+#0#4'Data'#10#8#0#0#0#4#0#0#0#2#2#2#2#0#0#14'TFloatSpinEdit'#9'fseBounds'#4
+'Left'#3#204#0#6'Height'#2#23#3'Top'#2#17#5'Width'#2'2'#9'Increment'#5#0#208
+#204#204#204#204#204#204#251'?'#8'MaxValue'#5#0#0#0#0#0#0#0#160#2'@'#8'MinVa'
+'lue'#5#0#0#0#0#0#0#0#128#255'?'#8'OnChange'#7#15'fseBoundsChange'#8'TabOrde'
+'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
Classes, ExtCtrls, Spin, StdCtrls, SysUtils, FileUtil, LResources, Forms,
Controls, Graphics, Dialogs, TAGraph, TASeries;
Controls, Graphics, Dialogs, TAGraph, TASeries, TASources;
type
@ -23,6 +23,7 @@ type
fseBounds: TFloatSpinEdit;
lblBoundValue: TLabel;
Panel1: TPanel;
RandomChartSource1: TRandomChartSource;
procedure cgUseBoundsItemClick(Sender: TObject; Index: integer);
procedure FormCreate(Sender: TObject);
procedure fseBoundsChange(Sender: TObject);
@ -46,12 +47,7 @@ begin
end;
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
RandSeed := 342432;
for i := -10 to 10 do
Chart1LineSeries.AddXY(i * 0.5, Random(20) * 0.5 - 5);
fseBoundsChange(nil);
end;