mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 20:00:20 +02:00
TAChart: Add demo for chart sources.
git-svn-id: trunk@20155 -
This commit is contained in:
parent
c17a63df84
commit
029339a761
5
.gitattributes
vendored
5
.gitattributes
vendored
@ -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
|
||||
|
71
components/tachart/demo/chartsource/chartsourcedemo.lpi
Normal file
71
components/tachart/demo/chartsource/chartsourcedemo.lpi
Normal file
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="7"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<SaveClosedFiles Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<TargetFileExt Value=".exe"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
</General>
|
||||
<VersionInfo>
|
||||
<ProjectVersion Value=""/>
|
||||
</VersionInfo>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IgnoreBinaries Value="False"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="TAChartLazarusPkg"/>
|
||||
<MinVersion Major="1" Valid="True"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="chartsourcedemo.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="chartsourcedemo"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="main.pas"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Main"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="8"/>
|
||||
<PathDelim Value="\"/>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)\"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
<Other>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
</CONFIG>
|
20
components/tachart/demo/chartsource/chartsourcedemo.lpr
Normal file
20
components/tachart/demo/chartsource/chartsourcedemo.lpr
Normal file
@ -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.
|
||||
|
112
components/tachart/demo/chartsource/main.lfm
Normal file
112
components/tachart/demo/chartsource/main.lfm
Normal file
@ -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
|
37
components/tachart/demo/chartsource/main.lrs
Normal file
37
components/tachart/demo/chartsource/main.lrs
Normal file
@ -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
|
||||
]);
|
37
components/tachart/demo/chartsource/main.pas
Normal file
37
components/tachart/demo/chartsource/main.pas
Normal file
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user