From 9267ee571f60595dd78167156c64fc69818bdea6 Mon Sep 17 00:00:00 2001 From: ask Date: Sun, 12 Dec 2010 09:08:16 +0000 Subject: [PATCH] TAChart: Add label angle control to the radial demo git-svn-id: trunk@28693 - --- components/tachart/demo/radial/main.lfm | 28 +++++++++++++++++++++---- components/tachart/demo/radial/main.pas | 8 +++++++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/components/tachart/demo/radial/main.lfm b/components/tachart/demo/radial/main.lfm index a19e704c86..edeeb40004 100644 --- a/components/tachart/demo/radial/main.lfm +++ b/components/tachart/demo/radial/main.lfm @@ -47,6 +47,7 @@ object Form1: TForm1 ParentColor = False OnMouseDown = ChartPieMouseDown object ChartPiePieSeries1: TPieSeries + Marks.Distance = 40 Marks.Format = '%2:s' Marks.Style = smsLabel Exploded = True @@ -60,7 +61,7 @@ object Form1: TForm1 Width = 558 Align = alTop Alignment = taLeftJustify - Caption = 'Click on the slice to explodede/unxeplode it' + Caption = 'Click on the slice to explode/unxeplode it' ClientHeight = 35 ClientWidth = 558 TabOrder = 1 @@ -74,13 +75,32 @@ object Form1: TForm1 TabOrder = 0 end object lblWords: TLabel - Left = 428 + Left = 424 Height = 14 - Top = 6 + Top = 10 Width = 58 Caption = 'Label words' ParentColor = False end + object seLabelAngle: TSpinEdit + Left = 360 + Height = 21 + Top = 6 + Width = 50 + Increment = 5 + MaxValue = 360 + MinValue = -360 + OnChange = seLabelAngleChange + TabOrder = 1 + end + object lblLabelAngle: TLabel + Left = 296 + Height = 14 + Top = 10 + Width = 55 + Caption = 'Label angle' + ParentColor = False + end end end end @@ -95,7 +115,7 @@ object Form1: TForm1 '0|1|?|' '0|2|?|' '0|3|?|' - '0|0|?|' + '0|5|?|' ) left = 440 top = 136 diff --git a/components/tachart/demo/radial/main.pas b/components/tachart/demo/radial/main.pas index 322f050e33..c8ee9894a0 100644 --- a/components/tachart/demo/radial/main.pas +++ b/components/tachart/demo/radial/main.pas @@ -17,14 +17,17 @@ type ChartPiePieSeries1: TPieSeries; ChartToolset1: TChartToolset; lblWords: TLabel; + lblLabelAngle: TLabel; ListChartSource1: TListChartSource; PageControl1: TPageControl; Panel1: TPanel; seWords: TSpinEdit; + seLabelAngle: TSpinEdit; tsPie: TTabSheet; procedure ChartPieMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure seWordsChange(Sender: TObject); + procedure seLabelAngleChange(Sender: TObject); end; var @@ -81,5 +84,10 @@ begin ChartPie.Invalidate; end; +procedure TForm1.seLabelAngleChange(Sender: TObject); +begin + ChartPiePieSeries1.Marks.LabelFont.Orientation := seLabelAngle.Value * 10; +end; + end.