TAChart: Add chart cloning to the cloning demo

git-svn-id: trunk@29372 -
This commit is contained in:
ask 2011-02-04 07:59:01 +00:00
parent 08523f26a1
commit 7f4a651ff3
2 changed files with 73 additions and 5 deletions

View File

@ -3,6 +3,7 @@ object Form1: TForm1
Height = 510
Top = 263
Width = 739
AutoScroll = True
Caption = 'Form1'
ClientHeight = 510
ClientWidth = 739
@ -86,6 +87,66 @@ object Form1: TForm1
end
end
end
object tsCharts: TTabSheet
Caption = 'Charts'
ClientHeight = 484
ClientWidth = 731
object Chart1: TChart
Left = 0
Height = 128
Top = 0
Width = 731
AxisList = <
item
Alignment = calRight
Grid.Visible = False
Inverted = True
Title.LabelFont.Orientation = 900
end
item
Alignment = calBottom
end>
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue
Title.Brush.Color = clBtnFace
Title.Font.Color = clBlue
Title.Text.Strings = (
'TAChart'
)
Align = alTop
ParentColor = False
object Chart1AreaSeries1: TAreaSeries
Marks.Clipped = False
Marks.Format = '%0:.1g'
Marks.Style = smsCustom
AreaBrush.Color = clOlive
AreaBrush.Style = bsDiagCross
AreaContourPen.Color = clMaroon
AreaContourPen.Width = 2
AreaLinesPen.Style = psClear
Source = RandomChartSource1
end
end
object Panel2: TPanel
Left = 0
Height = 40
Top = 444
Width = 731
Align = alBottom
ClientHeight = 40
ClientWidth = 731
TabOrder = 1
object btnClone: TButton
Left = 4
Height = 25
Top = 6
Width = 75
Caption = 'Clone'
OnClick = btnCloneClick
TabOrder = 0
end
end
end
end
object RandomChartSource1: TRandomChartSource
PointsNumber = 20

View File

@ -15,20 +15,22 @@ type
TForm1 = class(TForm)
btnLine: TButton;
btnBar: TButton;
btnClone: TButton;
Chart1: TChart;
Chart1AreaSeries1: TAreaSeries;
ChartSeries: TChart;
ChartSeriesBarSeries1: TBarSeries;
ChartSeriesLineSeries1: TLineSeries;
PageControl1: TPageControl;
Panel1: TPanel;
Panel2: TPanel;
RandomChartSource1: TRandomChartSource;
tsCharts: TTabSheet;
tsSeries: TTabSheet;
procedure btnBarClick(Sender: TObject);
procedure btnCloneClick(Sender: TObject);
procedure btnLineClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
end;
var
Form1: TForm1;
@ -54,6 +56,11 @@ begin
end;
end;
procedure TForm1.btnCloneClick(Sender: TObject);
begin
Chart1.Clone;
end;
procedure TForm1.btnLineClick(Sender: TObject);
var
ls: TLineSeries;