From 029339a761ed2f8aeda93e8712eeb357ec281d85 Mon Sep 17 00:00:00 2001 From: ask Date: Sun, 24 May 2009 06:34:22 +0000 Subject: [PATCH] TAChart: Add demo for chart sources. git-svn-id: trunk@20155 - --- .gitattributes | 5 + .../demo/chartsource/chartsourcedemo.lpi | 71 +++++++++++ .../demo/chartsource/chartsourcedemo.lpr | 20 ++++ components/tachart/demo/chartsource/main.lfm | 112 ++++++++++++++++++ components/tachart/demo/chartsource/main.lrs | 37 ++++++ components/tachart/demo/chartsource/main.pas | 37 ++++++ 6 files changed, 282 insertions(+) create mode 100644 components/tachart/demo/chartsource/chartsourcedemo.lpi create mode 100644 components/tachart/demo/chartsource/chartsourcedemo.lpr create mode 100644 components/tachart/demo/chartsource/main.lfm create mode 100644 components/tachart/demo/chartsource/main.lrs create mode 100644 components/tachart/demo/chartsource/main.pas diff --git a/.gitattributes b/.gitattributes index 19f7e1aa26..ce54d6bd39 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1542,6 +1542,11 @@ components/tachart/demo/basic/demo.lpr svneol=native#text/plain components/tachart/demo/basic/unit1.lfm svneol=native#text/plain components/tachart/demo/basic/unit1.lrs svneol=native#text/plain components/tachart/demo/basic/unit1.pas svneol=native#text/plain +components/tachart/demo/chartsource/chartsourcedemo.lpi svneol=native#text/plain +components/tachart/demo/chartsource/chartsourcedemo.lpr svneol=native#text/plain +components/tachart/demo/chartsource/main.lfm svneol=native#text/plain +components/tachart/demo/chartsource/main.lrs svneol=native#text/plain +components/tachart/demo/chartsource/main.pas svneol=native#text/pascal components/tachart/demo/dragdrop/dragdropdemo.lpi svneol=native#text/plain components/tachart/demo/dragdrop/dragdropdemo.lpr svneol=native#text/plain components/tachart/demo/dragdrop/main.lfm svneol=native#text/plain diff --git a/components/tachart/demo/chartsource/chartsourcedemo.lpi b/components/tachart/demo/chartsource/chartsourcedemo.lpi new file mode 100644 index 0000000000..5e4ac42eec --- /dev/null +++ b/components/tachart/demo/chartsource/chartsourcedemo.lpi @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/tachart/demo/chartsource/chartsourcedemo.lpr b/components/tachart/demo/chartsource/chartsourcedemo.lpr new file mode 100644 index 0000000000..25d0cb518e --- /dev/null +++ b/components/tachart/demo/chartsource/chartsourcedemo.lpr @@ -0,0 +1,20 @@ +program chartsourcedemo; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, Main, TAChartLazarusPkg + { you can add units after this }; + +{$IFDEF WINDOWS}{$R chartsourcedemo.rc}{$ENDIF} + +begin + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/components/tachart/demo/chartsource/main.lfm b/components/tachart/demo/chartsource/main.lfm new file mode 100644 index 0000000000..354145340d --- /dev/null +++ b/components/tachart/demo/chartsource/main.lfm @@ -0,0 +1,112 @@ +object Form1: TForm1 + Left = 342 + Height = 385 + Top = 199 + Width = 559 + Caption = 'Form1' + ClientHeight = 385 + ClientWidth = 559 + LCLVersion = '0.9.27' + 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 + BottomAxis.Grid.Style = psDot + Foot.Brush.Color = clBtnFace + Foot.Font.Color = clBlue + LeftAxis.Grid.Style = psDot + LeftAxis.Title.Angle = 90 + 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 + Pointer.Brush.Color = clBlue + SeriesColor = clBlue + ShowPoints = True + Source = ListChartSource1 + end + end + object Chart2: TChart + Left = 0 + Height = 337 + Top = 48 + Width = 288 + BottomAxis.Grid.Style = psDot + Foot.Brush.Color = clBtnFace + Foot.Font.Color = clBlue + LeftAxis.Grid.Style = psDot + LeftAxis.Title.Angle = 90 + Title.Brush.Color = clBtnFace + Title.Font.Color = clBlue + Title.Text.Strings = ( + 'TAChart' + ) + Align = alClient + ParentColor = False + object Chart2LineSeries1: TLineSeries + Pointer.Brush.Color = clRed + SeriesColor = clRed + ShowPoints = True + Source = RandomChartSource1 + end + object Chart2AreaSeries1: TAreaSeries + AreaLinesPen.Color = clMaroon + AreaBrush.Color = clBlue + SeriesColor = clBlue + Source = ListChartSource1 + end + end + object Splitter1: TSplitter + Left = 288 + Height = 337 + Top = 48 + Width = 5 + Align = alRight + Beveled = True + ResizeAnchor = akRight + end + object RandomChartSource1: TRandomChartSource + PointsNumber = 8 + RandSeed = 624484796 + XMax = 5 + XMin = -5 + YMax = 10 + YMin = 0 + left = 240 + top = 204 + end + object ListChartSource1: TListChartSource + DataPoints.Strings = ( + '-3|2||' + '-2|3||' + '-1|4||' + '0|1||' + '3|2||' + ) + left = 240 + top = 260 + end +end diff --git a/components/tachart/demo/chartsource/main.lrs b/components/tachart/demo/chartsource/main.lrs new file mode 100644 index 0000000000..52bc4685f9 --- /dev/null +++ b/components/tachart/demo/chartsource/main.lrs @@ -0,0 +1,37 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TForm1','FORMDATA',[ + 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'V'#1#6'Height'#3#129#1#3'Top'#3#199#0#5'W' + +'idth'#3'/'#2#7'Caption'#6#5'Form1'#12'ClientHeight'#3#129#1#11'ClientWidth' + +#3'/'#2#10'LCLVersion'#6#6'0.9.27'#0#5'TMemo'#5'Memo1'#4'Left'#2#0#6'Height' + +#2'0'#3'Top'#2#0#5'Width'#3'/'#2#5'Align'#7#5'alTop'#13'Lines.Strings'#1#6#30 + +'Modify sources at design-time.'#6'8Same-colored series from each chart have' + +' common sources.'#0#8'TabOrder'#2#0#0#0#6'TChart'#6'Chart1'#4'Left'#3'%'#1#6 + +'Height'#3'Q'#1#3'Top'#2'0'#5'Width'#3#10#1#21'BottomAxis.Grid.Style'#7#5'ps' + +'Dot'#16'Foot.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.Brus' + +'h.Color'#7#9'clBtnFace'#16'Title.Font.Color'#7#6'clBlue'#18'Title.Text.Stri' + +'ngs'#1#6#7'TAChart'#0#5'Align'#7#7'alRight'#11'ParentColor'#8#0#10'TBarSeri' + +'es'#16'Chart1BarSeries1'#14'BarBrush.Color'#7#5'clRed'#11'SeriesColor'#7#5 + +'clRed'#6'Source'#7#18'RandomChartSource1'#0#0#11'TLineSeries'#17'Chart1Line' + +'Series1'#9'ZPosition'#2#1#19'Pointer.Brush.Color'#7#6'clBlue'#11'SeriesColo' + +'r'#7#6'clBlue'#10'ShowPoints'#9#6'Source'#7#16'ListChartSource1'#0#0#0#6'TC' + +'hart'#6'Chart2'#4'Left'#2#0#6'Height'#3'Q'#1#3'Top'#2'0'#5'Width'#3' '#1#21 + +'BottomAxis.Grid.Style'#7#5'psDot'#16'Foot.Brush.Color'#7#9'clBtnFace'#15'Fo' + +'ot.Font.Color'#7#6'clBlue'#19'LeftAxis.Grid.Style'#7#5'psDot'#20'LeftAxis.T' + +'itle.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#11'TLineSeries'#17'Chart2LineSeries1'#19'Pointer.Brush.Col' + +'or'#7#5'clRed'#11'SeriesColor'#7#5'clRed'#10'ShowPoints'#9#6'Source'#7#18'R' + +'andomChartSource1'#0#0#11'TAreaSeries'#17'Chart2AreaSeries1'#18'AreaLinesPe' + +'n.Color'#7#8'clMaroon'#15'AreaBrush.Color'#7#6'clBlue'#11'SeriesColor'#7#6 + +'clBlue'#6'Source'#7#16'ListChartSource1'#0#0#0#9'TSplitter'#9'Splitter1'#4 + +'Left'#3' '#1#6'Height'#3'Q'#1#3'Top'#2'0'#5'Width'#2#5#5'Align'#7#7'alRight' + +#7'Beveled'#9#12'ResizeAnchor'#7#7'akRight'#0#0#18'TRandomChartSource'#18'Ra' + +'ndomChartSource1'#12'PointsNumber'#2#8#8'RandSeed'#4#188#225'8%'#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#2'@'#4'YMin'#5#0#0#0#0#0#0#0#0#0#0#4'left'#3#240#0#3'top'#3#204#0#0#0 + +#16'TListChartSource'#16'ListChartSource1'#18'DataPoints.Strings'#1#6#6'-3|2' + +'||'#6#6'-2|3||'#6#6'-1|4||'#6#5'0|1||'#6#5'3|2||'#0#4'left'#3#240#0#3'top'#3 + +#4#1#0#0#0 +]); diff --git a/components/tachart/demo/chartsource/main.pas b/components/tachart/demo/chartsource/main.pas new file mode 100644 index 0000000000..b49d123ac0 --- /dev/null +++ b/components/tachart/demo/chartsource/main.pas @@ -0,0 +1,37 @@ +unit Main; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, ExtCtrls, StdCtrls, SysUtils, FileUtil, LResources, Forms, Controls, + Graphics, Dialogs, TAGraph, TASeries, TASources; + +type + + { TForm1 } + + TForm1 = class(TForm) + Chart1: TChart; + Chart1BarSeries1: TBarSeries; + Chart1LineSeries1: TLineSeries; + Chart2: TChart; + Chart2AreaSeries1: TAreaSeries; + Chart2LineSeries1: TLineSeries; + ListChartSource1: TListChartSource; + Memo1: TMemo; + RandomChartSource1: TRandomChartSource; + Splitter1: TSplitter; + end; + +var + Form1: TForm1; + +implementation + +initialization + {$I main.lrs} + +end. +