From 7f4a651ff3b9bc774517e7b7e7487825e7a62793 Mon Sep 17 00:00:00 2001 From: ask Date: Fri, 4 Feb 2011 07:59:01 +0000 Subject: [PATCH] TAChart: Add chart cloning to the cloning demo git-svn-id: trunk@29372 - --- components/tachart/demo/clone/Main.lfm | 61 ++++++++++++++++++++++++++ components/tachart/demo/clone/Main.pas | 17 ++++--- 2 files changed, 73 insertions(+), 5 deletions(-) diff --git a/components/tachart/demo/clone/Main.lfm b/components/tachart/demo/clone/Main.lfm index 3ff2014742..587efe86b8 100644 --- a/components/tachart/demo/clone/Main.lfm +++ b/components/tachart/demo/clone/Main.lfm @@ -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 diff --git a/components/tachart/demo/clone/Main.pas b/components/tachart/demo/clone/Main.pas index d7a0fdd184..9ef00ad15c 100644 --- a/components/tachart/demo/clone/Main.pas +++ b/components/tachart/demo/clone/Main.pas @@ -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;