mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 17:39:22 +02:00
TAChart: Show some dummy data in dbdemo to start with.
git-svn-id: trunk@54272 -
This commit is contained in:
parent
9d64ee4506
commit
533405f98c
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectOptions>
|
<ProjectOptions>
|
||||||
<Version Value="9"/>
|
<Version Value="10"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<General>
|
<General>
|
||||||
<Flags>
|
<Flags>
|
||||||
@ -12,10 +12,11 @@
|
|||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
<Title Value="Chart db-aware demo"/>
|
<Title Value="Chart db-aware demo"/>
|
||||||
<ResourceType Value="res"/>
|
<ResourceType Value="res"/>
|
||||||
|
<UseXPManifest Value="True"/>
|
||||||
</General>
|
</General>
|
||||||
<VersionInfo>
|
<BuildModes Count="1">
|
||||||
<StringTable ProductVersion=""/>
|
<Item1 Name="default" Default="True"/>
|
||||||
</VersionInfo>
|
</BuildModes>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
<IgnoreBinaries Value="False"/>
|
<IgnoreBinaries Value="False"/>
|
||||||
@ -49,19 +50,19 @@
|
|||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="dbdemo.lpr"/>
|
<Filename Value="dbdemo.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<UnitName Value="dbdemo"/>
|
|
||||||
</Unit0>
|
</Unit0>
|
||||||
<Unit1>
|
<Unit1>
|
||||||
<Filename Value="main.pas"/>
|
<Filename Value="main.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<ComponentName Value="Form1"/>
|
<ComponentName Value="Form1"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="Main"/>
|
<UnitName Value="Main"/>
|
||||||
</Unit1>
|
</Unit1>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
<Version Value="9"/>
|
<Version Value="11"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<SearchPaths>
|
<SearchPaths>
|
||||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
@ -79,12 +80,6 @@
|
|||||||
</Win32>
|
</Win32>
|
||||||
</Options>
|
</Options>
|
||||||
</Linking>
|
</Linking>
|
||||||
<Other>
|
|
||||||
<CompilerMessages>
|
|
||||||
<UseMsgFile Value="True"/>
|
|
||||||
</CompilerMessages>
|
|
||||||
<CompilerPath Value="$(CompPath)"/>
|
|
||||||
</Other>
|
|
||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
<Debugging>
|
<Debugging>
|
||||||
<Exceptions Count="3">
|
<Exceptions Count="3">
|
||||||
|
@ -10,6 +10,8 @@ uses
|
|||||||
Forms, Main, MemDSLaz, TAChartLazarusPkg
|
Forms, Main, MemDSLaz, TAChartLazarusPkg
|
||||||
{ you can add units after this };
|
{ you can add units after this };
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Application.Title := 'Chart db-aware demo';
|
Application.Title := 'Chart db-aware demo';
|
||||||
Application.Initialize;
|
Application.Initialize;
|
||||||
|
@ -6,8 +6,9 @@ object Form1: TForm1
|
|||||||
Caption = 'Form1'
|
Caption = 'Form1'
|
||||||
ClientHeight = 300
|
ClientHeight = 300
|
||||||
ClientWidth = 547
|
ClientWidth = 547
|
||||||
|
OnCreate = FormCreate
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '0.9.29'
|
LCLVersion = '1.7'
|
||||||
object Chart1: TChart
|
object Chart1: TChart
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 274
|
Height = 274
|
||||||
@ -15,10 +16,12 @@ object Form1: TForm1
|
|||||||
Width = 347
|
Width = 347
|
||||||
AxisList = <
|
AxisList = <
|
||||||
item
|
item
|
||||||
|
Minors = <>
|
||||||
Title.LabelFont.Orientation = 900
|
Title.LabelFont.Orientation = 900
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Alignment = calBottom
|
Alignment = calBottom
|
||||||
|
Minors = <>
|
||||||
end>
|
end>
|
||||||
Foot.Brush.Color = clBtnFace
|
Foot.Brush.Color = clBtnFace
|
||||||
Foot.Font.Color = clBlue
|
Foot.Font.Color = clBlue
|
||||||
@ -32,11 +35,14 @@ object Form1: TForm1
|
|||||||
'TAChart'
|
'TAChart'
|
||||||
)
|
)
|
||||||
Align = alClient
|
Align = alClient
|
||||||
ParentColor = False
|
|
||||||
object Chart1LineSeries1: TLineSeries
|
object Chart1LineSeries1: TLineSeries
|
||||||
ZPosition = 1
|
ZPosition = 1
|
||||||
LinePen.Color = clTeal
|
LinePen.Color = clTeal
|
||||||
LinePen.Width = 3
|
LinePen.Width = 3
|
||||||
|
Pointer.HorizSize = 6
|
||||||
|
Pointer.Style = psCircle
|
||||||
|
Pointer.VertSize = 6
|
||||||
|
ShowPoints = True
|
||||||
Source = DbChartSource1
|
Source = DbChartSource1
|
||||||
end
|
end
|
||||||
object Chart1BarSeries1: TBarSeries
|
object Chart1BarSeries1: TBarSeries
|
||||||
@ -49,6 +55,8 @@ object Form1: TForm1
|
|||||||
Top = 26
|
Top = 26
|
||||||
Width = 200
|
Width = 200
|
||||||
Align = alRight
|
Align = alRight
|
||||||
|
AutoFillColumns = True
|
||||||
|
Color = clWindow
|
||||||
Columns = <>
|
Columns = <>
|
||||||
DataSource = Datasource1
|
DataSource = Datasource1
|
||||||
Scrollbars = ssAutoBoth
|
Scrollbars = ssAutoBoth
|
||||||
@ -75,19 +83,15 @@ object Form1: TForm1
|
|||||||
item
|
item
|
||||||
Name = 'X'
|
Name = 'X'
|
||||||
DataType = ftFloat
|
DataType = ftFloat
|
||||||
Precision = 0
|
|
||||||
Size = 0
|
|
||||||
end
|
end
|
||||||
item
|
item
|
||||||
Name = 'Y'
|
Name = 'Y'
|
||||||
DataType = ftFloat
|
DataType = ftFloat
|
||||||
Precision = 0
|
|
||||||
Size = 0
|
|
||||||
end>
|
end>
|
||||||
left = 271
|
left = 271
|
||||||
top = 60
|
top = 60
|
||||||
end
|
end
|
||||||
object Datasource1: TDatasource
|
object Datasource1: TDataSource
|
||||||
DataSet = MemDataset1
|
DataSet = MemDataset1
|
||||||
left = 271
|
left = 271
|
||||||
top = 108
|
top = 108
|
||||||
|
@ -5,7 +5,7 @@ unit Main;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
ComCtrls, db, DBGrids, memds, Forms, TADbSource, TAGraph, TASeries;
|
ComCtrls, db, DBGrids, memds, Forms, TADbSource, TAGraph, TASeries, Classes;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -21,6 +21,7 @@ type
|
|||||||
MemDataset1: TMemDataset;
|
MemDataset1: TMemDataset;
|
||||||
ToolBar1: TToolBar;
|
ToolBar1: TToolBar;
|
||||||
tbCopy: TToolButton;
|
tbCopy: TToolButton;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure tbCopyClick(Sender: TObject);
|
procedure tbCopyClick(Sender: TObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -33,6 +34,24 @@ implementation
|
|||||||
|
|
||||||
{ TForm1 }
|
{ TForm1 }
|
||||||
|
|
||||||
|
{ Add dummy data to start with }
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
const
|
||||||
|
N = 3;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
Fx, Fy: TField;
|
||||||
|
begin
|
||||||
|
Fx := MemDataset1.FieldByName('X');
|
||||||
|
Fy := MemDataset1.FieldByName('Y');
|
||||||
|
for i:= 1 to N do begin
|
||||||
|
MemDataset1.Append;
|
||||||
|
Fx.AsInteger := i;
|
||||||
|
Fy.AsFloat := Random;
|
||||||
|
MemDataset1.Post;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TForm1.tbCopyClick(Sender: TObject);
|
procedure TForm1.tbCopyClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Chart1BarSeries1.ListSource.CopyFrom(DbChartSource1);
|
Chart1BarSeries1.ListSource.CopyFrom(DbChartSource1);
|
||||||
|
Loading…
Reference in New Issue
Block a user