mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-20 12:19:31 +02:00
TAChart: Add a demo for db-aware chart
git-svn-id: trunk@20218 -
This commit is contained in:
parent
dedefbbe48
commit
2ba755f1ef
5
.gitattributes
vendored
5
.gitattributes
vendored
@ -1547,6 +1547,11 @@ 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/db/dbdemo.lpi svneol=native#text/plain
|
||||
components/tachart/demo/db/dbdemo.lpr svneol=native#text/pascal
|
||||
components/tachart/demo/db/main.lfm svneol=native#text/plain
|
||||
components/tachart/demo/db/main.lrs svneol=native#text/plain
|
||||
components/tachart/demo/db/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
|
||||
|
80
components/tachart/demo/db/dbdemo.lpi
Normal file
80
components/tachart/demo/db/dbdemo.lpi
Normal file
@ -0,0 +1,80 @@
|
||||
<?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"/>
|
||||
<Title Value="Chart db-aware demo"/>
|
||||
<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="4">
|
||||
<Item1>
|
||||
<PackageName Value="FCL"/>
|
||||
<MinVersion Major="1" Valid="True"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="MemDSLaz"/>
|
||||
<MinVersion Major="1" Minor="2" Release="1" Valid="True"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<PackageName Value="TAChartLazarusPkg"/>
|
||||
<MinVersion Major="1" Valid="True"/>
|
||||
</Item3>
|
||||
<Item4>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item4>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="dbdemo.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="dbdemo"/>
|
||||
</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>
|
21
components/tachart/demo/db/dbdemo.lpr
Normal file
21
components/tachart/demo/db/dbdemo.lpr
Normal file
@ -0,0 +1,21 @@
|
||||
program dbdemo;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, Main, MemDSLaz, TAChartLazarusPkg
|
||||
{ you can add units after this };
|
||||
|
||||
{$IFDEF WINDOWS}{$R dbdemo.rc}{$ENDIF}
|
||||
|
||||
begin
|
||||
Application.Title := 'Chart db-aware demo';
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
73
components/tachart/demo/db/main.lfm
Normal file
73
components/tachart/demo/db/main.lfm
Normal file
@ -0,0 +1,73 @@
|
||||
object Form1: TForm1
|
||||
Left = 318
|
||||
Height = 300
|
||||
Top = 151
|
||||
Width = 547
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 300
|
||||
ClientWidth = 547
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '0.9.27'
|
||||
object Chart1: TChart
|
||||
Left = 0
|
||||
Height = 300
|
||||
Top = 0
|
||||
Width = 347
|
||||
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 Chart1LineSeries1: TLineSeries
|
||||
SeriesColor = clBlack
|
||||
Source = DbChartSource1
|
||||
end
|
||||
end
|
||||
object DBGrid1: TDBGrid
|
||||
Left = 347
|
||||
Height = 300
|
||||
Top = 0
|
||||
Width = 200
|
||||
Align = alRight
|
||||
DataSource = Datasource1
|
||||
Scrollbars = ssAutoBoth
|
||||
TabOrder = 1
|
||||
end
|
||||
object MemDataset1: TMemDataset
|
||||
Active = True
|
||||
FieldDefs = <
|
||||
item
|
||||
Name = 'X'
|
||||
DataType = ftFloat
|
||||
Precision = 0
|
||||
Size = 0
|
||||
end
|
||||
item
|
||||
Name = 'Y'
|
||||
DataType = ftFloat
|
||||
Precision = 0
|
||||
Size = 0
|
||||
end>
|
||||
left = 271
|
||||
top = 60
|
||||
end
|
||||
object Datasource1: TDatasource
|
||||
DataSet = MemDataset1
|
||||
left = 271
|
||||
top = 108
|
||||
end
|
||||
object DbChartSource1: TDbChartSource
|
||||
DataSource = Datasource1
|
||||
FieldX = 'X'
|
||||
FieldY = 'Y'
|
||||
left = 271
|
||||
top = 156
|
||||
end
|
||||
end
|
23
components/tachart/demo/db/main.lrs
Normal file
23
components/tachart/demo/db/main.lrs
Normal file
@ -0,0 +1,23 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TForm1','FORMDATA',[
|
||||
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'>'#1#6'Height'#3','#1#3'Top'#3#151#0#5'Wi'
|
||||
+'dth'#3'#'#2#7'Caption'#6#5'Form1'#12'ClientHeight'#3','#1#11'ClientWidth'#3
|
||||
+'#'#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'['#1#21'Bottom'
|
||||
+'Axis.Grid.Style'#7#5'psDot'#16'Foot.Brush.Color'#7#9'clBtnFace'#15'Foot.Fon'
|
||||
+'t.Color'#7#6'clBlue'#19'LeftAxis.Grid.Style'#7#5'psDot'#20'LeftAxis.Title.A'
|
||||
+'ngle'#2'Z'#17'Title.Brush.Color'#7#9'clBtnFace'#16'Title.Font.Color'#7#6'cl'
|
||||
+'Blue'#18'Title.Text.Strings'#1#6#7'TAChart'#0#5'Align'#7#8'alClient'#11'Par'
|
||||
+'entColor'#8#0#11'TLineSeries'#17'Chart1LineSeries1'#11'SeriesColor'#7#7'clB'
|
||||
+'lack'#6'Source'#7#14'DbChartSource1'#0#0#0#7'TDBGrid'#7'DBGrid1'#4'Left'#3
|
||||
+'['#1#6'Height'#3','#1#3'Top'#2#0#5'Width'#3#200#0#5'Align'#7#7'alRight'#10
|
||||
+'DataSource'#7#11'Datasource1'#10'Scrollbars'#7#10'ssAutoBoth'#8'TabOrder'#2
|
||||
+#1#0#0#11'TMemDataset'#11'MemDataset1'#6'Active'#9#9'FieldDefs'#14#1#4'Name'
|
||||
+#6#1'X'#8'DataType'#7#7'ftFloat'#9'Precision'#2#0#4'Size'#2#0#0#1#4'Name'#6#1
|
||||
+'Y'#8'DataType'#7#7'ftFloat'#9'Precision'#2#0#4'Size'#2#0#0#0#4'left'#3#15#1
|
||||
+#3'top'#2'<'#0#0#11'TDatasource'#11'Datasource1'#7'DataSet'#7#11'MemDataset1'
|
||||
+#4'left'#3#15#1#3'top'#2'l'#0#0#14'TDbChartSource'#14'DbChartSource1'#10'Dat'
|
||||
+'aSource'#7#11'Datasource1'#6'FieldX'#6#1'X'#6'FieldY'#6#1'Y'#4'left'#3#15#1
|
||||
+#3'top'#3#156#0#0#0#0
|
||||
]);
|
33
components/tachart/demo/db/main.pas
Normal file
33
components/tachart/demo/db/main.pas
Normal file
@ -0,0 +1,33 @@
|
||||
unit Main;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, db, DBGrids, memds, SysUtils, FileUtil, LResources, Forms, Controls,
|
||||
Graphics, Dialogs, TADbSource, TAGraph, TASeries;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
Chart1: TChart;
|
||||
Chart1LineSeries1: TLineSeries;
|
||||
Datasource1: TDatasource;
|
||||
DbChartSource1: TDbChartSource;
|
||||
DBGrid1: TDBGrid;
|
||||
MemDataset1: TMemDataset;
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
initialization
|
||||
{$I main.lrs}
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user