mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-06 11:41:04 +02:00
TAChart: Add chart events demo
git-svn-id: trunk@28889 -
This commit is contained in:
parent
65a1965f94
commit
bfac641b16
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -2252,6 +2252,10 @@ components/tachart/demo/dragdrop/dragdropdemo.lpi svneol=native#text/plain
|
|||||||
components/tachart/demo/dragdrop/dragdropdemo.lpr svneol=native#text/plain
|
components/tachart/demo/dragdrop/dragdropdemo.lpr svneol=native#text/plain
|
||||||
components/tachart/demo/dragdrop/main.lfm svneol=native#text/plain
|
components/tachart/demo/dragdrop/main.lfm svneol=native#text/plain
|
||||||
components/tachart/demo/dragdrop/main.pas svneol=native#text/pascal
|
components/tachart/demo/dragdrop/main.pas svneol=native#text/pascal
|
||||||
|
components/tachart/demo/events/Main.lfm svneol=native#text/plain
|
||||||
|
components/tachart/demo/events/Main.pas svneol=native#text/pascal
|
||||||
|
components/tachart/demo/events/eventsdemo.lpi svneol=native#text/plain
|
||||||
|
components/tachart/demo/events/eventsdemo.lpr svneol=native#text/pascal
|
||||||
components/tachart/demo/extent/extentdemo.lpi svneol=native#text/plain
|
components/tachart/demo/extent/extentdemo.lpi svneol=native#text/plain
|
||||||
components/tachart/demo/extent/extentdemo.lpr svneol=native#text/plain
|
components/tachart/demo/extent/extentdemo.lpr svneol=native#text/plain
|
||||||
components/tachart/demo/extent/main.lfm svneol=native#text/plain
|
components/tachart/demo/extent/main.lfm svneol=native#text/plain
|
||||||
|
49
components/tachart/demo/events/Main.lfm
Normal file
49
components/tachart/demo/events/Main.lfm
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
object Form1: TForm1
|
||||||
|
Left = 296
|
||||||
|
Height = 240
|
||||||
|
Top = 124
|
||||||
|
Width = 320
|
||||||
|
Caption = 'Form1'
|
||||||
|
ClientHeight = 240
|
||||||
|
ClientWidth = 320
|
||||||
|
LCLVersion = '0.9.31'
|
||||||
|
object Chart1: TChart
|
||||||
|
Left = 0
|
||||||
|
Height = 240
|
||||||
|
Top = 0
|
||||||
|
Width = 320
|
||||||
|
AxisList = <
|
||||||
|
item
|
||||||
|
Title.LabelFont.Orientation = 900
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Alignment = calBottom
|
||||||
|
end>
|
||||||
|
Depth = 15
|
||||||
|
Foot.Brush.Color = clBtnFace
|
||||||
|
Foot.Font.Color = clBlue
|
||||||
|
Title.Brush.Color = clBtnFace
|
||||||
|
Title.Font.Color = clBlue
|
||||||
|
Title.Text.Strings = (
|
||||||
|
'TAChart'
|
||||||
|
)
|
||||||
|
OnBeforeDrawBackground = Chart1BeforeDrawBackground
|
||||||
|
OnBeforeDrawBackWall = Chart1BeforeDrawBackWall
|
||||||
|
Align = alClient
|
||||||
|
ParentColor = False
|
||||||
|
object Chart1BarSeries1: TBarSeries
|
||||||
|
BarBrush.Color = clRed
|
||||||
|
Source = RandomChartSource1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object RandomChartSource1: TRandomChartSource
|
||||||
|
PointsNumber = 10
|
||||||
|
RandSeed = 1499557333
|
||||||
|
XMax = 13
|
||||||
|
XMin = 3
|
||||||
|
YMax = 20
|
||||||
|
YMin = 2
|
||||||
|
left = 248
|
||||||
|
top = 28
|
||||||
|
end
|
||||||
|
end
|
49
components/tachart/demo/events/Main.pas
Normal file
49
components/tachart/demo/events/Main.pas
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
unit Main;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, TAGraph,
|
||||||
|
TASeries, TASources;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
Chart1: TChart;
|
||||||
|
Chart1BarSeries1: TBarSeries;
|
||||||
|
RandomChartSource1: TRandomChartSource;
|
||||||
|
procedure Chart1BeforeDrawBackground(ASender: TChart; ACanvas: TCanvas;
|
||||||
|
const ARect: TRect; var ADoDefaultDrawing: Boolean);
|
||||||
|
procedure Chart1BeforeDrawBackWall(ASender: TChart; ACanvas: TCanvas;
|
||||||
|
const ARect: TRect; var ADoDefaultDrawing: Boolean);
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.lfm}
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
procedure TForm1.Chart1BeforeDrawBackground(ASender: TChart; ACanvas: TCanvas;
|
||||||
|
const ARect: TRect; var ADoDefaultDrawing: Boolean);
|
||||||
|
begin
|
||||||
|
ACanvas.GradientFill(ARect, $FFFFFF, $FF8080, gdVertical);
|
||||||
|
ADoDefaultDrawing := false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Chart1BeforeDrawBackWall(ASender: TChart; ACanvas: TCanvas;
|
||||||
|
const ARect: TRect; var ADoDefaultDrawing: Boolean);
|
||||||
|
begin
|
||||||
|
ACanvas.GradientFill(ARect, $FFFFFF, $80FF80, gdVertical);
|
||||||
|
ADoDefaultDrawing := false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
92
components/tachart/demo/events/eventsdemo.lpi
Normal file
92
components/tachart/demo/events/eventsdemo.lpi
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<Version Value="9"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<General>
|
||||||
|
<SessionStorage Value="InProjectDir"/>
|
||||||
|
<MainUnit Value="0"/>
|
||||||
|
<ResourceType Value="res"/>
|
||||||
|
<UseXPManifest Value="True"/>
|
||||||
|
</General>
|
||||||
|
<i18n>
|
||||||
|
<EnableI18N LFM="False"/>
|
||||||
|
</i18n>
|
||||||
|
<VersionInfo>
|
||||||
|
<StringTable ProductVersion=""/>
|
||||||
|
</VersionInfo>
|
||||||
|
<BuildModes Count="1">
|
||||||
|
<Item1 Name="Default" Default="True"/>
|
||||||
|
</BuildModes>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
|
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<local>
|
||||||
|
<FormatVersion Value="1"/>
|
||||||
|
</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="eventsdemo.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="eventsdemo"/>
|
||||||
|
</Unit0>
|
||||||
|
<Unit1>
|
||||||
|
<Filename Value="Main.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="Form1"/>
|
||||||
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="Main"/>
|
||||||
|
</Unit1>
|
||||||
|
</Units>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="9"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Target>
|
||||||
|
<Filename Value="eventsdemo"/>
|
||||||
|
</Target>
|
||||||
|
<SearchPaths>
|
||||||
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
|
</SearchPaths>
|
||||||
|
<Linking>
|
||||||
|
<Options>
|
||||||
|
<Win32>
|
||||||
|
<GraphicApplication Value="True"/>
|
||||||
|
</Win32>
|
||||||
|
</Options>
|
||||||
|
</Linking>
|
||||||
|
<Other>
|
||||||
|
<CompilerMessages>
|
||||||
|
<UseMsgFile Value="True"/>
|
||||||
|
</CompilerMessages>
|
||||||
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
|
</Other>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="3">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="EAbort"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item2>
|
||||||
|
<Item3>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item3>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
19
components/tachart/demo/events/eventsdemo.lpr
Normal file
19
components/tachart/demo/events/eventsdemo.lpr
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
program eventsdemo;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||||
|
cthreads,
|
||||||
|
{$ENDIF}{$ENDIF}
|
||||||
|
Interfaces, // this includes the LCL widgetset
|
||||||
|
Forms, Main, tachartlazaruspkg;
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user