added tachart components from Philippe Martinole and Luis Rodrigues (bug #8269)

git-svn-id: trunk@10658 -
This commit is contained in:
vincents 2007-02-19 15:17:14 +00:00
parent 8e0bc658e1
commit 7d1493c48a
12 changed files with 4500 additions and 0 deletions

11
.gitattributes vendored
View File

@ -603,6 +603,17 @@ components/synunihighlighter/synuni.pas svneol=native#text/pascal
components/synunihighlighter/synunidesigner.pas svneol=native#text/pascal
components/synunihighlighter/synunihighlighter.pas svneol=native#text/pascal
components/synunihighlighter/synunireg.pas svneol=native#text/pascal
components/tachart/README.txt svneol=native#text/plain
components/tachart/TAEngine.pas svneol=native#text/plain
components/tachart/TAGraph.pas svneol=native#text/plain
components/tachart/TASeries.pas svneol=native#text/plain
components/tachart/demo/demo.lpi svneol=native#text/plain
components/tachart/demo/demo.lpr svneol=native#text/plain
components/tachart/demo/unit1.lfm svneol=native#text/plain
components/tachart/demo/unit1.lrs svneol=native#text/plain
components/tachart/demo/unit1.pas svneol=native#text/plain
components/tachart/tachartlazaruspkg.lpk svneol=native#text/plain
components/tachart/tachartlazaruspkg.pas svneol=native#text/plain
components/tdbf/Makefile svneol=native#text/plain
components/tdbf/Makefile.fpc svneol=native#text/plain
components/tdbf/dbflaz.lpk svneol=native#text/pascal

View File

@ -0,0 +1,46 @@
TAChart is a charting LGPL component for Lazarus (TeeChart like).
It contains the functions that Philippe Martinole developed for the TeleAuto project and lots
of changes introduced by Luis Rodrigues while porting the Epanet application from Delphi to Lazarus.
Its main caracteristics are :
* Pie Series
* Bar Series
* Area Series
* Line Series (can work as Point Series)
* Unlimited number of graphs
* Unlimited number of points
* Graph legend
* Graph title
* Graph footer
* Axis labels
* Interactive zoom
* Reticule or vertical reticule with point measure
* Mirror on X axis
* Auto or manual graph limits
* Smart marks drawing
* Vertical and horizontal line graph type
* Easily extensible to new graph types
Why Create This
---------------
I've been porting Epanet from Delphi into Lazarus, since I need a TeeChart like component and TeeChart was not free
I had to build a new component.
I looked arround the net for a good component and found Philippe's TAChart and decided to improve it.
There is still plenty of bugs on the component but at least it works with all the cases I need. I will continue to develop
this, but since it's allready working I decided to submit to general review.
Installation
------------
* Open the package tachartlazaruspkg.lpk with Component / Open package file (.lpk)
* Click on Compile
* Click on Install
Copyright (C) 2005-2006 by Philippe Martinole <philippe.martinole@teleauto.org>
Copyright (C) 2006-2006 by Luis Rodrigues <lr@neei.uevora.pt>

View File

@ -0,0 +1,45 @@
{
/***************************************************************************
TAEngine.pp
----------
Component Library Standard Graph Helper Functions / Classes
***************************************************************************/
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.modifiedLGPL, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
*****************************************************************************
}
unit TAEngine;
interface
uses Classes;
type
TSeriesList = class(TList)
private
// function Add(Item: TASeries): Integer; override;
end;
implementation
end.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,200 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="/"/>
<Version Value="5"/>
<General>
<MainUnit Value="0"/>
<TargetFileExt Value=""/>
<ActiveEditorIndexAtStart Value="2"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<Language Value=""/>
<CharSet 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 Valid="True"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="4">
<Unit0>
<Filename Value="demo.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="demo"/>
<UsageCount Value="20"/>
</Unit0>
<Unit1>
<Filename Value="unit1.pas"/>
<ComponentName Value="Form1"/>
<IsPartOfProject Value="True"/>
<ResourceFilename Value="unit1.lrs"/>
<UnitName Value="unit1"/>
<CursorPos X="6" Y="172"/>
<TopLine Value="154"/>
<EditorIndex Value="0"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
<Filename Value="../../lcl/buttons.pp"/>
<UnitName Value="Buttons"/>
<CursorPos X="12" Y="11"/>
<TopLine Value="1"/>
<EditorIndex Value="2"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit2>
<Unit3>
<Filename Value="../../lcl/lresources.pp"/>
<UnitName Value="LResources"/>
<CursorPos X="31" Y="10"/>
<TopLine Value="1"/>
<EditorIndex Value="1"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit3>
</Units>
<JumpHistory Count="24" HistoryIndex="23">
<Position1>
<Filename Value="unit1.pas"/>
<Caret Line="149" Column="35" TopLine="127"/>
</Position1>
<Position2>
<Filename Value="unit1.pas"/>
<Caret Line="19" Column="7" TopLine="15"/>
</Position2>
<Position3>
<Filename Value="unit1.pas"/>
<Caret Line="41" Column="29" TopLine="28"/>
</Position3>
<Position4>
<Filename Value="unit1.pas"/>
<Caret Line="2" Column="14" TopLine="2"/>
</Position4>
<Position5>
<Filename Value="unit1.pas"/>
<Caret Line="16" Column="17" TopLine="2"/>
</Position5>
<Position6>
<Filename Value="unit1.pas"/>
<Caret Line="20" Column="22" TopLine="19"/>
</Position6>
<Position7>
<Filename Value="unit1.pas"/>
<Caret Line="34" Column="12" TopLine="19"/>
</Position7>
<Position8>
<Filename Value="unit1.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position8>
<Position9>
<Filename Value="unit1.pas"/>
<Caret Line="25" Column="16" TopLine="11"/>
</Position9>
<Position10>
<Filename Value="unit1.pas"/>
<Caret Line="29" Column="26" TopLine="9"/>
</Position10>
<Position11>
<Filename Value="unit1.pas"/>
<Caret Line="21" Column="1" TopLine="9"/>
</Position11>
<Position12>
<Filename Value="unit1.pas"/>
<Caret Line="47" Column="8" TopLine="33"/>
</Position12>
<Position13>
<Filename Value="unit1.pas"/>
<Caret Line="9" Column="12" TopLine="1"/>
</Position13>
<Position14>
<Filename Value="../../lcl/buttons.pp"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position14>
<Position15>
<Filename Value="../../lcl/buttons.pp"/>
<Caret Line="9" Column="1" TopLine="1"/>
</Position15>
<Position16>
<Filename Value="../../lcl/buttons.pp"/>
<Caret Line="11" Column="12" TopLine="1"/>
</Position16>
<Position17>
<Filename Value="unit1.pas"/>
<Caret Line="9" Column="22" TopLine="1"/>
</Position17>
<Position18>
<Filename Value="unit1.pas"/>
<Caret Line="173" Column="1" TopLine="154"/>
</Position18>
<Position19>
<Filename Value="unit1.pas"/>
<Caret Line="8" Column="31" TopLine="1"/>
</Position19>
<Position20>
<Filename Value="../../lcl/lresources.pp"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position20>
<Position21>
<Filename Value="../../lcl/lresources.pp"/>
<Caret Line="8" Column="31" TopLine="1"/>
</Position21>
<Position22>
<Filename Value="../../lcl/lresources.pp"/>
<Caret Line="10" Column="31" TopLine="1"/>
</Position22>
<Position23>
<Filename Value="unit1.pas"/>
<Caret Line="8" Column="31" TopLine="1"/>
</Position23>
<Position24>
<Filename Value="unit1.pas"/>
<Caret Line="172" Column="6" TopLine="154"/>
</Position24>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="2">
<Item1>
<Name Value="ECodetoolError"/>
</Item1>
<Item2>
<Name Value="EFOpenError"/>
</Item2>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,18 @@
program demo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms
{ add your units here }, unit1, TAChartLazarusPkg;
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,210 @@
object Form1: TForm1
Left = 290
Height = 499
Top = 202
Width = 585
HorzScrollBar.Page = 584
VertScrollBar.Page = 498
Caption = 'Form1'
object Chart1: TChart
Height = 430
Width = 585
AutoUpdateXMin = True
AutoUpdateXMax = True
AutoUpdateYMin = True
AutoUpdateYMax = True
Legend.Alignment = laRight
Legend.Font.Height = -11
Legend.Font.Name = 'MS Sans Serif'
Legend.Frame.OnChange = nil
Legend.OnChange = nil
Title.Visible = True
Title.Brush.Color = clBtnFace
Title.Font.Color = clBlue
Title.Font.Height = -11
Title.Font.Name = 'MS Sans Serif'
Title.Frame.OnChange = nil
Title.Alignment = taCenter
Title.Text.Strings = (
'Centered Chart Title'
)
Title.OnChange = nil
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clRed
Foot.Font.Height = -13
Foot.Font.Name = 'MS Sans Serif'
Foot.Font.Style = [fsBold]
Foot.Frame.OnChange = nil
Foot.Alignment = taCenter
Foot.Text.Strings = (
'This a LeftAligned Footer'
)
Foot.OnChange = nil
AllowZoom = True
LeftAxis.Visible = True
LeftAxis.Title.Angle = 90
LeftAxis.Title.Font.Height = -11
LeftAxis.Title.Font.Name = 'MS Sans Serif'
LeftAxis.Title.OnChange = nil
LeftAxis.Grid.Color = clGray
LeftAxis.Grid.Style = psDot
LeftAxis.Grid.Visible = True
LeftAxis.Grid.OnChange = nil
LeftAxis.OnChange = nil
BottomAxis.Visible = True
BottomAxis.Title.Font.Height = -11
BottomAxis.Title.Font.Name = 'MS Sans Serif'
BottomAxis.Title.OnChange = nil
BottomAxis.Grid.Color = clGray
BottomAxis.Grid.Style = psDot
BottomAxis.Grid.Visible = True
BottomAxis.Grid.OnChange = nil
BottomAxis.OnChange = nil
Frame.Visible = True
Frame.OnChange = nil
BackColor = clBtnFace
AxisVisible = True
Align = alClient
Color = clBtnFace
ParentColor = False
end
object Panel1: TPanel
Height = 69
Top = 430
Width = 585
Align = alBottom
TabOrder = 0
OnClick = Panel1Click
object Button1: TButton
Left = 16
Height = 25
Top = 8
Width = 75
BorderSpacing.InnerBorder = 4
Caption = 'create pie'
OnClick = Button1Click
TabOrder = 0
end
object Button2: TButton
Left = 96
Height = 25
Top = 8
Width = 75
BorderSpacing.InnerBorder = 4
Caption = 'create area'
OnClick = Button2Click
TabOrder = 1
end
object Button3: TButton
Left = 96
Height = 25
Top = 40
Width = 75
BorderSpacing.InnerBorder = 4
Caption = 'create line'
OnClick = Button3Click
TabOrder = 2
end
object Button5: TButton
Left = 208
Height = 25
Top = 8
Width = 75
BorderSpacing.InnerBorder = 4
Caption = 'add pie'
OnClick = Button5Click
TabOrder = 3
end
object Button7: TButton
Left = 288
Height = 25
Top = 40
Width = 75
BorderSpacing.InnerBorder = 4
Caption = 'add line'
OnClick = Button7Click
TabOrder = 4
end
object Button8: TButton
Left = 288
Height = 25
Top = 8
Width = 75
BorderSpacing.InnerBorder = 4
Caption = 'add area'
OnClick = Button8Click
TabOrder = 5
end
object Button9: TButton
Left = 16
Height = 25
Top = 40
Width = 75
BorderSpacing.InnerBorder = 4
Caption = 'create bar'
OnClick = Button9Click
TabOrder = 6
end
object Button10: TButton
Left = 208
Height = 25
Top = 40
Width = 75
BorderSpacing.InnerBorder = 4
Caption = 'add bar'
OnClick = Button10Click
TabOrder = 7
end
object Legend: TCheckBox
Left = 408
Height = 21
Top = 8
Width = 64
Caption = 'Legend'
OnChange = LegendChange
TabOrder = 8
end
object CheckBox1: TCheckBox
Left = 408
Height = 21
Top = 24
Width = 90
Caption = 'Bottom Axis'
Checked = True
OnChange = CheckBox1Change
State = cbChecked
TabOrder = 9
end
object CheckBox2: TCheckBox
Left = 408
Height = 21
Top = 40
Width = 70
Caption = 'Left Axis'
Checked = True
OnChange = CheckBox2Change
State = cbChecked
TabOrder = 10
end
object CheckBox3: TCheckBox
Left = 496
Height = 21
Top = 8
Width = 44
Caption = 'title'
Checked = True
OnChange = CheckBox3Change
State = cbChecked
TabOrder = 11
end
object CheckBox4: TCheckBox
Left = 496
Height = 21
Top = 24
Width = 59
Caption = 'Footer'
OnChange = CheckBox4Change
TabOrder = 12
end
end
end

View File

@ -0,0 +1,63 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TForm1','FORMDATA',[
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'"'#1#6'Height'#3#243#1#3'Top'#3#202#0#5'W'
+'idth'#3'I'#2#18'HorzScrollBar.Page'#3'H'#2#18'VertScrollBar.Page'#3#242#1#7
+'Caption'#6#5'Form1'#0#6'TChart'#6'Chart1'#6'Height'#3#174#1#5'Width'#3'I'#2
+#14'AutoUpdateXMin'#9#14'AutoUpdateXMax'#9#14'AutoUpdateYMin'#9#14'AutoUpdat'
+'eYMax'#9#16'Legend.Alignment'#7#7'laRight'#18'Legend.Font.Height'#2#245#16
+'Legend.Font.Name'#6#13'MS Sans Serif'#21'Legend.Frame.OnChange'#13#15'Legen'
+'d.OnChange'#13#13'Title.Visible'#9#17'Title.Brush.Color'#7#9'clBtnFace'#16
+'Title.Font.Color'#7#6'clBlue'#17'Title.Font.Height'#2#245#15'Title.Font.Nam'
+'e'#6#13'MS Sans Serif'#20'Title.Frame.OnChange'#13#15'Title.Alignment'#7#8
+'taCenter'#18'Title.Text.Strings'#1#6#20'Centered Chart Title'#0#14'Title.On'
+'Change'#13#16'Foot.Brush.Color'#7#9'clBtnFace'#15'Foot.Font.Color'#7#5'clRe'
+'d'#16'Foot.Font.Height'#2#243#14'Foot.Font.Name'#6#13'MS Sans Serif'#15'Foo'
+'t.Font.Style'#11#6'fsBold'#0#19'Foot.Frame.OnChange'#13#14'Foot.Alignment'#7
+#8'taCenter'#17'Foot.Text.Strings'#1#6#25'This a LeftAligned Footer'#0#13'Fo'
+'ot.OnChange'#13#9'AllowZoom'#9#16'LeftAxis.Visible'#9#20'LeftAxis.Title.Ang'
+'le'#2'Z'#26'LeftAxis.Title.Font.Height'#2#245#24'LeftAxis.Title.Font.Name'#6
+#13'MS Sans Serif'#23'LeftAxis.Title.OnChange'#13#19'LeftAxis.Grid.Color'#7#6
+'clGray'#19'LeftAxis.Grid.Style'#7#5'psDot'#21'LeftAxis.Grid.Visible'#9#22'L'
+'eftAxis.Grid.OnChange'#13#17'LeftAxis.OnChange'#13#18'BottomAxis.Visible'#9
+#28'BottomAxis.Title.Font.Height'#2#245#26'BottomAxis.Title.Font.Name'#6#13
+'MS Sans Serif'#25'BottomAxis.Title.OnChange'#13#21'BottomAxis.Grid.Color'#7
+#6'clGray'#21'BottomAxis.Grid.Style'#7#5'psDot'#23'BottomAxis.Grid.Visible'#9
+#24'BottomAxis.Grid.OnChange'#13#19'BottomAxis.OnChange'#13#13'Frame.Visible'
+#9#14'Frame.OnChange'#13#9'BackColor'#7#9'clBtnFace'#11'AxisVisible'#9#5'Ali'
+'gn'#7#8'alClient'#5'Color'#7#9'clBtnFace'#11'ParentColor'#8#0#0#6'TPanel'#6
+'Panel1'#6'Height'#2'E'#3'Top'#3#174#1#5'Width'#3'I'#2#5'Align'#7#8'alBottom'
+#8'TabOrder'#2#0#7'OnClick'#7#11'Panel1Click'#0#7'TButton'#7'Button1'#4'Left'
+#2#16#6'Height'#2#25#3'Top'#2#8#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2
+#4#7'Caption'#6#10'create pie'#7'OnClick'#7#12'Button1Click'#8'TabOrder'#2#0
+#0#0#7'TButton'#7'Button2'#4'Left'#2'`'#6'Height'#2#25#3'Top'#2#8#5'Width'#2
+'K'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#11'create area'#7'OnClick'
+#7#12'Button2Click'#8'TabOrder'#2#1#0#0#7'TButton'#7'Button3'#4'Left'#2'`'#6
+'Height'#2#25#3'Top'#2'('#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#4#7
+'Caption'#6#11'create line'#7'OnClick'#7#12'Button3Click'#8'TabOrder'#2#2#0#0
+#7'TButton'#7'Button5'#4'Left'#3#208#0#6'Height'#2#25#3'Top'#2#8#5'Width'#2
+'K'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#7'add pie'#7'OnClick'#7#12
+'Button5Click'#8'TabOrder'#2#3#0#0#7'TButton'#7'Button7'#4'Left'#3' '#1#6'He'
+'ight'#2#25#3'Top'#2'('#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#4#7'Ca'
+'ption'#6#8'add line'#7'OnClick'#7#12'Button7Click'#8'TabOrder'#2#4#0#0#7'TB'
+'utton'#7'Button8'#4'Left'#3' '#1#6'Height'#2#25#3'Top'#2#8#5'Width'#2'K'#25
+'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#8'add area'#7'OnClick'#7#12'But'
+'ton8Click'#8'TabOrder'#2#5#0#0#7'TButton'#7'Button9'#4'Left'#2#16#6'Height'
+#2#25#3'Top'#2'('#5'Width'#2'K'#25'BorderSpacing.InnerBorder'#2#4#7'Caption'
+#6#10'create bar'#7'OnClick'#7#12'Button9Click'#8'TabOrder'#2#6#0#0#7'TButto'
+'n'#8'Button10'#4'Left'#3#208#0#6'Height'#2#25#3'Top'#2'('#5'Width'#2'K'#25
+'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#7'add bar'#7'OnClick'#7#13'Butt'
+'on10Click'#8'TabOrder'#2#7#0#0#9'TCheckBox'#6'Legend'#4'Left'#3#152#1#6'Hei'
+'ght'#2#21#3'Top'#2#8#5'Width'#2'@'#7'Caption'#6#6'Legend'#8'OnChange'#7#12
+'LegendChange'#8'TabOrder'#2#8#0#0#9'TCheckBox'#9'CheckBox1'#4'Left'#3#152#1
+#6'Height'#2#21#3'Top'#2#24#5'Width'#2'Z'#7'Caption'#6#11'Bottom Axis'#7'Che'
+'cked'#9#8'OnChange'#7#15'CheckBox1Change'#5'State'#7#9'cbChecked'#8'TabOrde'
+'r'#2#9#0#0#9'TCheckBox'#9'CheckBox2'#4'Left'#3#152#1#6'Height'#2#21#3'Top'#2
+'('#5'Width'#2'F'#7'Caption'#6#9'Left Axis'#7'Checked'#9#8'OnChange'#7#15'Ch'
+'eckBox2Change'#5'State'#7#9'cbChecked'#8'TabOrder'#2#10#0#0#9'TCheckBox'#9
+'CheckBox3'#4'Left'#3#240#1#6'Height'#2#21#3'Top'#2#8#5'Width'#2','#7'Captio'
+'n'#6#5'title'#7'Checked'#9#8'OnChange'#7#15'CheckBox3Change'#5'State'#7#9'c'
+'bChecked'#8'TabOrder'#2#11#0#0#9'TCheckBox'#9'CheckBox4'#4'Left'#3#240#1#6
+'Height'#2#21#3'Top'#2#24#5'Width'#2';'#7'Caption'#6#6'Footer'#8'OnChange'#7
+#15'CheckBox4Change'#8'TabOrder'#2#12#0#0#0#0
]);

View File

@ -0,0 +1,181 @@
unit unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
TAGraph, TASeries, Buttons, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Button10: TButton;
Button2: TButton;
Button3: TButton;
Button5: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
Chart1: TChart;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
Legend: TCheckBox;
Panel1: TPanel;
procedure Panel1Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure CheckBox1Change(Sender: TObject);
procedure CheckBox2Change(Sender: TObject);
procedure CheckBox3Change(Sender: TObject);
procedure CheckBox4Change(Sender: TObject);
procedure LegendChange(Sender: TObject);
private
s: TBarSeries;
d: TSerie;
p: TPieSeries;
a: TAreaSeries;
x,y,x1,y1, x3,y3: double;
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{ TForm1 }
procedure TForm1.Panel1Click(Sender: TObject);
begin
end;
procedure TForm1.Button9Click(Sender: TObject);
begin
s := TBarSeries.Create(Chart1);
Chart1.AddSerie(s);
s.title := 'barras';
s.SeriesColor := clRed;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
p := TPieSeries.Create(Chart1);
Chart1.AddSerie(p);
p.title := 'pie';
p.SeriesColor := clRed;
p.MarksStyle := taseries.smsLabelPercent;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
d:= TSerie.Create(Chart1);
d.ShowLines := true;
d.ShowPoints := true;
d.PointStyle := taseries.psRectangle;
d.title := 'line';
d.SeriesColor := clRed;
Chart1.AddSerie(d);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
a := TAreaSeries.Create(Chart1);
Chart1.AddSerie(a);
a.SeriesColor := clred;
a.Stairs := true;
a.InvertedStairs := false;
end;
procedure TForm1.Button8Click(Sender: TObject);
begin
X3 := X3 +1;
if (random(2) >= 0.7) then Y3 := Y3 + random(5)
else if (random(2) >= 0.7) then
Y3 := 0
else Y3 := Y3 - random(5);
a.AddXY(x3, y3, '', clTAColor);
end;
procedure TForm1.Button10Click(Sender: TObject);
begin
s.AddXY(x,y, '', clred);
X := X +1;
if (random(2) >= 0.7) then Y := Y + random(5)
else if (random(2) >= 0.7) then
Y := 0
else Y := Y - random(5);
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
d.AddXY(x1,y1, '', clgreen);
X1 := X1 +1.5;
if (random(2) >= 0.5) then Y1 := Y1 + random(10)
else Y1 := Y1 - random(5);
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
p.AddPie(3.4234235235, 'sde21312', clTAColor);
p.AddPie(0.2323, 'adassssssdddddd', clTAColor);
p.AddPie(30, 'filipe romao', clTAColor);
p.AddPie(40, '234eds sa', clTAColor);
end;
procedure TForm1.CheckBox1Change(Sender: TObject);
begin
Chart1.BottomAxis.Visible := CheckBox1.Checked;
end;
procedure TForm1.CheckBox2Change(Sender: TObject);
begin
Chart1.LeftAxis.Visible := CheckBox2.Checked;
end;
procedure TForm1.CheckBox3Change(Sender: TObject);
begin
Chart1.Title.Visible := CheckBox3.Checked;
end;
procedure TForm1.CheckBox4Change(Sender: TObject);
begin
Chart1.Foot.Visible := CheckBox4.Checked;
end;
procedure TForm1.LegendChange(Sender: TObject);
begin
chart1.Legend.Visible := Legend.Checked;
end;
initialization
{$I unit1.lrs}
end.

View File

@ -0,0 +1,56 @@
<?xml version="1.0"?>
<CONFIG>
<Package Version="2">
<Name Value="TAChartLazarusPkg"/>
<Author Value="Luís Rodrigues (lr@neei.uevora.pt)"/>
<CompilerOptions>
<Version Value="5"/>
<SearchPaths>
<OtherUnitFiles Value="/home/luis/compile/lazarus/TAChart_Final/"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Description Value="TeeChart compatible graph component"/>
<License Value=" See the file COPYING.modifiedLGPL, included in this distribution,
for details about the copyright.
"/>
<Files Count="3">
<Item1>
<Filename Value="TASeries.pas"/>
<UnitName Value="TASeries"/>
</Item1>
<Item2>
<Filename Value="TAEngine.pas"/>
<UnitName Value="TAEngine"/>
</Item2>
<Item3>
<Filename Value="TAGraph.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="TAGraph"/>
</Item3>
</Files>
<Type Value="RunAndDesignTime"/>
<RequiredPkgs Count="2">
<Item1>
<PackageName Value="LCL"/>
</Item1>
<Item2>
<PackageName Value="FCL"/>
<MinVersion Major="1" Valid="True"/>
</Item2>
</RequiredPkgs>
<UsageOptions>
<UnitPath Value="$(PkgOutDir)/"/>
</UsageOptions>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
</PublishOptions>
</Package>
</CONFIG>

View File

@ -0,0 +1,21 @@
{ This file was automatically created by Lazarus. Do not edit!
This source is only used to compile and install the package.
}
unit TAChartLazarusPkg;
interface
uses
TASeries, TAEngine, TAGraph, LazarusPackageIntf;
implementation
procedure Register;
begin
RegisterUnit('TAGraph', @TAGraph.Register);
end;
initialization
RegisterPackage('TAChartLazarusPkg', @Register);
end.