mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-03 20:47:09 +01:00
TAChart: Add ability to change Chart.Depth property to 3D demo
git-svn-id: trunk@23836 -
This commit is contained in:
parent
e3b8fd72eb
commit
d89034f76c
@ -1,16 +1,17 @@
|
|||||||
object Form1: TForm1
|
object Form1: TForm1
|
||||||
Left = 318
|
Left = 318
|
||||||
Height = 300
|
Height = 347
|
||||||
Top = 150
|
Top = 150
|
||||||
Width = 560
|
Width = 560
|
||||||
Caption = 'Form1'
|
Caption = 'Form1'
|
||||||
ClientHeight = 300
|
ClientHeight = 347
|
||||||
ClientWidth = 560
|
ClientWidth = 560
|
||||||
|
OnShow = FormShow
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '0.9.29'
|
LCLVersion = '0.9.29'
|
||||||
object Chart1: TChart
|
object Chart1: TChart
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 300
|
Height = 297
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 560
|
Width = 560
|
||||||
AxisList = <
|
AxisList = <
|
||||||
@ -62,6 +63,32 @@ object Form1: TForm1
|
|||||||
Source = RandomChartSource1
|
Source = RandomChartSource1
|
||||||
end
|
end
|
||||||
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
|
object RandomChartSource1: TRandomChartSource
|
||||||
PointsNumber = 7
|
PointsNumber = 7
|
||||||
RandSeed = 545516281
|
RandSeed = 545516281
|
||||||
|
|||||||
@ -5,7 +5,7 @@ unit main;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Forms,
|
ExtCtrls, Forms, Spin, StdCtrls,
|
||||||
TAGraph, TASeries, TASources;
|
TAGraph, TASeries, TASources;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -17,8 +17,13 @@ type
|
|||||||
Chart1BarSeries1: TBarSeries;
|
Chart1BarSeries1: TBarSeries;
|
||||||
Chart1BarSeries2: TBarSeries;
|
Chart1BarSeries2: TBarSeries;
|
||||||
Chart1LineSeries1: TLineSeries;
|
Chart1LineSeries1: TLineSeries;
|
||||||
|
lblDepth: TLabel;
|
||||||
|
pnControls: TPanel;
|
||||||
RandomChartSource1: TRandomChartSource;
|
RandomChartSource1: TRandomChartSource;
|
||||||
RandomChartSource2: TRandomChartSource;
|
RandomChartSource2: TRandomChartSource;
|
||||||
|
seDepth: TSpinEdit;
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure seDepthChange(Sender: TObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -28,5 +33,24 @@ implementation
|
|||||||
|
|
||||||
{$R *.lfm}
|
{$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.
|
end.
|
||||||
|
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
<ResourceType Value="res"/>
|
<ResourceType Value="res"/>
|
||||||
</General>
|
</General>
|
||||||
<VersionInfo>
|
<VersionInfo>
|
||||||
<ProjectVersion Value=""/>
|
<StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/>
|
||||||
</VersionInfo>
|
</VersionInfo>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user