mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 17:59:59 +02:00
TAChart: Initial implementation of 3D look. Add demo.
git-svn-id: trunk@19612 -
This commit is contained in:
parent
4b83c209c8
commit
0c273e0445
5
.gitattributes
vendored
5
.gitattributes
vendored
@ -1533,6 +1533,11 @@ components/tachart/taserieseditor.lrs svneol=native#text/plain
|
||||
components/tachart/taserieseditor.pas svneol=native#text/plain
|
||||
components/tachart/tatypes.pas svneol=native#text/plain
|
||||
components/tachart/tchart.png -text svneol=unset#images/png
|
||||
components/tachart/zdemo/main.lfm svneol=native#text/plain
|
||||
components/tachart/zdemo/main.lrs svneol=native#text/plain
|
||||
components/tachart/zdemo/main.pas svneol=native#text/plain
|
||||
components/tachart/zdemo/zdemo.lpi svneol=native#text/plain
|
||||
components/tachart/zdemo/zdemo.lpr 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
|
||||
|
@ -1038,23 +1038,30 @@ var
|
||||
begin
|
||||
if SeriesCount = 0 then exit;
|
||||
|
||||
// Set clipping region so we don't draw outside.
|
||||
// TODO: Replace by Canvas.ClipRect after fixing issue 13418.
|
||||
IntersectClipRect(
|
||||
ACanvas.Handle, FClipRect.Left, FClipRect.Top, FClipRect.Right, FClipRect.Bottom);
|
||||
|
||||
seriesInZOrder := GetSeriesInZOrder;
|
||||
try
|
||||
for i := 0 to SeriesCount - 1 do
|
||||
with TBasicChartSeries(seriesInZOrder[i]) do
|
||||
if Active then
|
||||
Draw(ACanvas);
|
||||
with TBasicChartSeries(seriesInZOrder[i]) do begin
|
||||
if not Active then continue;
|
||||
FOffset.X -= ZPosition;
|
||||
FOffset.Y += ZPosition;
|
||||
OffsetRect(FClipRect, -ZPosition, ZPosition);
|
||||
// Set clipping region so we don't draw outside.
|
||||
// TODO: Replace by Canvas.ClipRect after fixing issue 13418.
|
||||
IntersectClipRect(
|
||||
ACanvas.Handle,
|
||||
FClipRect.Left, FClipRect.Top, FClipRect.Right, FClipRect.Bottom);
|
||||
Draw(ACanvas);
|
||||
FOffset.X += ZPosition;
|
||||
FOffset.Y -= ZPosition;
|
||||
OffsetRect(FClipRect, ZPosition, -ZPosition);
|
||||
// Now disable clipping.
|
||||
SelectClipRgn(ACanvas.Handle, 0);
|
||||
end;
|
||||
finally
|
||||
seriesInZOrder.Free;
|
||||
end;
|
||||
|
||||
// Now disable clipping.
|
||||
SelectClipRgn(ACanvas.Handle, 0);
|
||||
end;
|
||||
|
||||
procedure TChart.DrawReticule(ACanvas: TCanvas);
|
||||
|
45
components/tachart/zdemo/main.lfm
Normal file
45
components/tachart/zdemo/main.lfm
Normal file
@ -0,0 +1,45 @@
|
||||
object Form1: TForm1
|
||||
Left = 318
|
||||
Height = 300
|
||||
Top = 150
|
||||
Width = 400
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 300
|
||||
ClientWidth = 400
|
||||
OnCreate = FormCreate
|
||||
LCLVersion = '0.9.27'
|
||||
object Chart1: TChart
|
||||
Height = 300
|
||||
Width = 400
|
||||
BottomAxis.Grid.Style = psDot
|
||||
BottomAxis.Grid.Visible = True
|
||||
Depth = 40
|
||||
Foot.Brush.Color = clBtnFace
|
||||
Foot.Font.Color = clBlue
|
||||
Frame.Visible = True
|
||||
LeftAxis.Grid.Style = psDot
|
||||
LeftAxis.Grid.Visible = True
|
||||
LeftAxis.Title.Angle = 90
|
||||
Title.Brush.Color = clBtnFace
|
||||
Title.Font.Color = clBlue
|
||||
Title.Text.Strings = (
|
||||
'TAChart'
|
||||
)
|
||||
Align = alClient
|
||||
ParentColor = False
|
||||
object Chart1BarSeries1: TBarSeries
|
||||
BarBrush.Color = clTeal
|
||||
SeriesColor = clTeal
|
||||
end
|
||||
object Chart1BarSeries2: TBarSeries
|
||||
ZPosition = 20
|
||||
BarBrush.Color = clMaroon
|
||||
SeriesColor = clMaroon
|
||||
end
|
||||
object Chart1BarSeries3: TBarSeries
|
||||
ZPosition = 40
|
||||
BarBrush.Color = clBlue
|
||||
SeriesColor = clBlue
|
||||
end
|
||||
end
|
||||
end
|
18
components/tachart/zdemo/main.lrs
Normal file
18
components/tachart/zdemo/main.lrs
Normal file
@ -0,0 +1,18 @@
|
||||
{ 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#150#0#5'Wi'
|
||||
+'dth'#3#144#1#7'Caption'#6#5'Form1'#12'ClientHeight'#3','#1#11'ClientWidth'#3
|
||||
+#144#1#8'OnCreate'#7#10'FormCreate'#10'LCLVersion'#6#6'0.9.27'#0#6'TChart'#6
|
||||
+'Chart1'#6'Height'#3','#1#5'Width'#3#144#1#21'BottomAxis.Grid.Style'#7#5'psD'
|
||||
+'ot'#23'BottomAxis.Grid.Visible'#9#5'Depth'#2'('#16'Foot.Brush.Color'#7#9'cl'
|
||||
+'BtnFace'#15'Foot.Font.Color'#7#6'clBlue'#13'Frame.Visible'#9#19'LeftAxis.Gr'
|
||||
+'id.Style'#7#5'psDot'#21'LeftAxis.Grid.Visible'#9#20'LeftAxis.Title.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#10'TBarSeries'#16'Chart1BarSeries1'#14'BarBrush.Color'#7#6'clTeal'#11'S'
|
||||
+'eriesColor'#7#6'clTeal'#0#0#10'TBarSeries'#16'Chart1BarSeries2'#9'ZPosition'
|
||||
+#2#20#14'BarBrush.Color'#7#8'clMaroon'#11'SeriesColor'#7#8'clMaroon'#0#0#10
|
||||
+'TBarSeries'#16'Chart1BarSeries3'#9'ZPosition'#2'('#14'BarBrush.Color'#7#6'c'
|
||||
+'lBlue'#11'SeriesColor'#7#6'clBlue'#0#0#0#0
|
||||
]);
|
46
components/tachart/zdemo/main.pas
Normal file
46
components/tachart/zdemo/main.pas
Normal file
@ -0,0 +1,46 @@
|
||||
unit main;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
||||
TAGraph, TASeries;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
Chart1: TChart;
|
||||
Chart1BarSeries1: TBarSeries;
|
||||
Chart1BarSeries2: TBarSeries;
|
||||
Chart1BarSeries3: TBarSeries;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
RandSeed := 876234;
|
||||
for i := 1 to 7 do begin
|
||||
Chart1BarSeries1.AddXY(i, Random(8) + 4);
|
||||
Chart1BarSeries2.AddXY(i, Random(8) + 4);
|
||||
Chart1BarSeries3.AddXY(i, Random(8) + 4);
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$I main.lrs}
|
||||
|
||||
end.
|
||||
|
73
components/tachart/zdemo/zdemo.lpi
Normal file
73
components/tachart/zdemo/zdemo.lpi
Normal file
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="7"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<AlwaysBuild Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<TargetFileExt Value=".exe"/>
|
||||
<Title Value="TAChart 3D look demo"/>
|
||||
<Icon Value="0"/>
|
||||
<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="zdemo.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="zdemo"/>
|
||||
</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>
|
22
components/tachart/zdemo/zdemo.lpr
Normal file
22
components/tachart/zdemo/zdemo.lpr
Normal file
@ -0,0 +1,22 @@
|
||||
program zdemo;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms
|
||||
{ you can add units after this }, main, LResources, TAChartLazarusPkg;
|
||||
|
||||
{$IFDEF WINDOWS}{$R zdemo.rc}{$ENDIF}
|
||||
|
||||
begin
|
||||
Application.Title := 'TAChart 3D look demo';
|
||||
{$I zdemo.lrs}
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user