TAChart: Update demos to use MarginX and MarginY properties

git-svn-id: trunk@27261 -
This commit is contained in:
ask 2010-09-04 06:33:21 +00:00
parent 0fb7f8fc83
commit 94c95314be
3 changed files with 71 additions and 48 deletions

View File

@ -14,9 +14,7 @@ object Form1: TForm1
Width = 510 Width = 510
AxisList = < AxisList = <
item item
Alignment = calLeft
Title.LabelFont.Orientation = 900 Title.LabelFont.Orientation = 900
Title.Font.Orientation = 900
Visible = False Visible = False
end end
item item
@ -40,7 +38,6 @@ object Form1: TForm1
Title = 'Line' Title = 'Line'
LinePen.Color = clRed LinePen.Color = clRed
Pointer.Brush.Color = clRed Pointer.Brush.Color = clRed
SeriesColor = clRed
ShowPoints = True ShowPoints = True
Source = ListChartSource1 Source = ListChartSource1
end end
@ -48,7 +45,6 @@ object Form1: TForm1
Title = 'Area' Title = 'Area'
AreaBrush.Color = clGreen AreaBrush.Color = clGreen
AreaBrush.Style = bsCross AreaBrush.Style = bsCross
SeriesColor = clGreen
Source = RandomChartSource1 Source = RandomChartSource1
end end
object Chart1PieSeries1: TPieSeries object Chart1PieSeries1: TPieSeries
@ -67,50 +63,32 @@ object Form1: TForm1
ClientHeight = 62 ClientHeight = 62
ClientWidth = 510 ClientWidth = 510
TabOrder = 1 TabOrder = 1
object seSpacing: TSpinEdit object lblMarginY: TLabel
Left = 8
Height = 14
Top = 33
Width = 42
Caption = 'Y margin'
ParentColor = False
end
object seMarginY: TSpinEdit
Left = 60 Left = 60
Height = 21 Height = 21
Top = 8 Top = 33
Width = 54 Width = 54
MaxValue = 20 MaxValue = 20
OnChange = seSpacingChange OnChange = seMarginYChange
TabOrder = 0 TabOrder = 0
Value = 4 Value = 4
end end
object lblSpacing: TLabel
Left = 8
Height = 14
Top = 8
Width = 38
Caption = 'Spacing'
ParentColor = False
end
object lblMargin: TLabel
Left = 12
Height = 14
Top = 33
Width = 33
Caption = 'Margin'
ParentColor = False
end
object seMargin: TSpinEdit
Left = 60
Height = 21
Top = 33
Width = 54
MaxValue = 20
OnChange = seMarginChange
TabOrder = 1
Value = 4
end
object seSymbolWidth: TSpinEdit object seSymbolWidth: TSpinEdit
Left = 200 Left = 196
Height = 21 Height = 21
Top = 8 Top = 8
Width = 54 Width = 54
MaxValue = 50 MaxValue = 50
OnChange = seSymbolWidthChange OnChange = seSymbolWidthChange
TabOrder = 2 TabOrder = 1
Value = 20 Value = 20
end end
object lblSymbolWidth: TLabel object lblSymbolWidth: TLabel
@ -148,10 +126,10 @@ object Form1: TForm1
'BottomRight' 'BottomRight'
) )
OnClick = rgAlignmentClick OnClick = rgAlignmentClick
TabOrder = 3 TabOrder = 2
end end
object cbUseSidebar: TCheckBox object cbUseSidebar: TCheckBox
Left = 128 Left = 256
Height = 17 Height = 17
Top = 33 Top = 33
Width = 56 Width = 56
@ -159,7 +137,43 @@ object Form1: TForm1
Checked = True Checked = True
OnChange = cbUseSidebarChange OnChange = cbUseSidebarChange
State = cbChecked State = cbChecked
TabOrder = 3
end
object lblSpacing: TLabel
Left = 128
Height = 14
Top = 33
Width = 38
Caption = 'Spacing'
ParentColor = False
end
object seSpacing: TSpinEdit
Left = 196
Height = 21
Top = 33
Width = 54
MaxValue = 20
OnChange = seSpacingChange
TabOrder = 4 TabOrder = 4
Value = 4
end
object lblMarginX: TLabel
Left = 8
Height = 14
Top = 8
Width = 42
Caption = 'X margin'
ParentColor = False
end
object seMarginX: TSpinEdit
Left = 60
Height = 21
Top = 8
Width = 54
MaxValue = 20
OnChange = seMarginXChange
TabOrder = 5
Value = 4
end end
end end
object RandomChartSource1: TRandomChartSource object RandomChartSource1: TRandomChartSource

View File

@ -5,7 +5,7 @@ unit main;
interface interface
uses uses
ExtCtrls, Spin, StdCtrls, Forms, TAGraph, TASeries, TASources; ExtCtrls, Spin, StdCtrls, Forms, TAGraph, TASeries, TASources, Classes;
type type
@ -17,20 +17,23 @@ type
Chart1LineSeries1: TLineSeries; Chart1LineSeries1: TLineSeries;
Chart1PieSeries1: TPieSeries; Chart1PieSeries1: TPieSeries;
cbUseSidebar: TCheckBox; cbUseSidebar: TCheckBox;
lblSymbolWidth: TLabel;
lblSpacing: TLabel; lblSpacing: TLabel;
lblMargin: TLabel; lblMarginX: TLabel;
lblSymbolWidth: TLabel;
lblMarginY: TLabel;
ListChartSource1: TListChartSource; ListChartSource1: TListChartSource;
ListChartSource2: TListChartSource; ListChartSource2: TListChartSource;
pnControls: TPanel; pnControls: TPanel;
rgAlignment: TRadioGroup; rgAlignment: TRadioGroup;
RandomChartSource1: TRandomChartSource; RandomChartSource1: TRandomChartSource;
seSymbolWidth: TSpinEdit;
seSpacing: TSpinEdit; seSpacing: TSpinEdit;
seMargin: TSpinEdit; seMarginX: TSpinEdit;
seSymbolWidth: TSpinEdit;
seMarginY: TSpinEdit;
procedure cbUseSidebarChange(Sender: TObject); procedure cbUseSidebarChange(Sender: TObject);
procedure rgAlignmentClick(Sender: TObject); procedure rgAlignmentClick(Sender: TObject);
procedure seMarginChange(Sender: TObject); procedure seMarginXChange(Sender: TObject);
procedure seMarginYChange(Sender: TObject);
procedure seSpacingChange(Sender: TObject); procedure seSpacingChange(Sender: TObject);
procedure seSymbolWidthChange(Sender: TObject); procedure seSymbolWidthChange(Sender: TObject);
end; end;
@ -63,9 +66,14 @@ begin
end; end;
end; end;
procedure TForm1.seMarginChange(Sender: TObject); procedure TForm1.seMarginXChange(Sender: TObject);
begin begin
Chart1.Legend.Margin := seMargin.Value; Chart1.Legend.MarginX := seMarginX.Value;
end;
procedure TForm1.seMarginYChange(Sender: TObject);
begin
Chart1.Legend.MarginY := seMarginY.Value;
end; end;
procedure TForm1.seSpacingChange(Sender: TObject); procedure TForm1.seSpacingChange(Sender: TObject);

View File

@ -1,7 +1,7 @@
object Form1: TForm1 object Form1: TForm1
Left = 293 Left = 703
Height = 479 Height = 479
Top = 182 Top = 364
Width = 589 Width = 589
Caption = 'Form1' Caption = 'Form1'
ClientHeight = 479 ClientHeight = 479
@ -167,7 +167,8 @@ object Form1: TForm1
Foot.Brush.Color = clBtnFace Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue Foot.Font.Color = clBlue
Legend.Alignment = laTopLeft Legend.Alignment = laTopLeft
Legend.Margin = 30 Legend.MarginX = 40
Legend.MarginY = 10
Legend.UseSidebar = False Legend.UseSidebar = False
Legend.Visible = True Legend.Visible = True
Title.Brush.Color = clBtnFace Title.Brush.Color = clBtnFace