TAChart: Add ability to change Chart.Depth property to 3D demo

git-svn-id: trunk@23836 -
This commit is contained in:
ask 2010-03-04 00:50:17 +00:00
parent e3b8fd72eb
commit d89034f76c
3 changed files with 56 additions and 5 deletions

View File

@ -1,16 +1,17 @@
object Form1: TForm1
Left = 318
Height = 300
Height = 347
Top = 150
Width = 560
Caption = 'Form1'
ClientHeight = 300
ClientHeight = 347
ClientWidth = 560
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '0.9.29'
object Chart1: TChart
Left = 0
Height = 300
Height = 297
Top = 0
Width = 560
AxisList = <
@ -62,6 +63,32 @@ object Form1: TForm1
Source = RandomChartSource1
end
end
object pnControls: TPanel
Left = 0
Height = 50
Top = 297
Width = 560
Align = alBottom
ClientHeight = 50
ClientWidth = 560
TabOrder = 1
object seDepth: TSpinEdit
Left = 52
Height = 21
Top = 7
Width = 74
OnChange = seDepthChange
TabOrder = 0
end
object lblDepth: TLabel
Left = 4
Height = 14
Top = 7
Width = 34
Caption = 'Depth:'
ParentColor = False
end
end
object RandomChartSource1: TRandomChartSource
PointsNumber = 7
RandSeed = 545516281

View File

@ -5,7 +5,7 @@ unit main;
interface
uses
Forms,
ExtCtrls, Forms, Spin, StdCtrls,
TAGraph, TASeries, TASources;
type
@ -17,8 +17,13 @@ type
Chart1BarSeries1: TBarSeries;
Chart1BarSeries2: TBarSeries;
Chart1LineSeries1: TLineSeries;
lblDepth: TLabel;
pnControls: TPanel;
RandomChartSource1: TRandomChartSource;
RandomChartSource2: TRandomChartSource;
seDepth: TSpinEdit;
procedure FormShow(Sender: TObject);
procedure seDepthChange(Sender: TObject);
end;
var
@ -28,5 +33,24 @@ implementation
{$R *.lfm}
uses
Math;
{ TForm1 }
procedure TForm1.FormShow(Sender: TObject);
begin
seDepth.Value := Chart1.Depth;
end;
procedure TForm1.seDepthChange(Sender: TObject);
var
i: Integer;
begin
Chart1.Depth := seDepth.Value;
for i := 0 to Chart1.SeriesCount - 1 do
Chart1.Series[i].Depth := Min(seDepth.Value, 10);
end;
end.

View File

@ -15,7 +15,7 @@
<ResourceType Value="res"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>