TAChart: Update "labels" demo to show callouts

git-svn-id: trunk@38582 -
This commit is contained in:
ask 2012-09-08 16:10:40 +00:00
parent dc94200051
commit 400dc6d8e4
2 changed files with 40 additions and 10 deletions

View File

@ -72,18 +72,18 @@ object Form1: TForm1
Marks.Frame.Color = 31097
Marks.Frame.Width = 2
Marks.Style = smsPercent
BarBrush.Color = clRed
BarBrush.Color = 1410280
Source = RandomChartSource1
end
end
end
object Multiline: TTabSheet
Caption = 'Multiline'
ClientHeight = 338
ClientHeight = 342
ClientWidth = 584
object ChartMulti: TChart
Left = 0
Height = 338
Height = 342
Top = 0
Width = 584
AxisList = <
@ -135,7 +135,7 @@ object Form1: TForm1
ClientWidth = 592
TabOrder = 1
object cbHideOverlapping: TCheckBox
Left = 336
Left = 412
Height = 17
Top = 12
Width = 130
@ -147,11 +147,11 @@ object Form1: TForm1
Left = 0
Height = 62
Top = 0
Width = 312
Width = 392
Align = alLeft
Caption = ' Angles '
ClientHeight = 44
ClientWidth = 308
ClientWidth = 388
TabOrder = 1
object seAxisAngle: TSpinEdit
Left = 32
@ -181,7 +181,7 @@ object Form1: TForm1
ParentColor = False
end
object seSeriesAngle: TSpinEdit
Left = 134
Left = 132
Height = 21
Top = 4
Width = 50
@ -192,7 +192,7 @@ object Form1: TForm1
TabOrder = 1
end
object lblTitleAngle: TLabel
Left = 202
Left = 206
Height = 13
Top = 8
Width = 20
@ -200,7 +200,7 @@ object Form1: TForm1
ParentColor = False
end
object seTitleAngle: TSpinEdit
Left = 226
Left = 232
Height = 21
Top = 4
Width = 50
@ -210,9 +210,27 @@ object Form1: TForm1
OnChange = seTitleAngleChange
TabOrder = 2
end
object seCalloutAngle: TSpinEdit
Left = 332
Height = 21
Top = 4
Width = 50
Increment = 5
MaxValue = 120
OnChange = seCalloutAngleChange
TabOrder = 3
end
object lblCalloutAngle: TLabel
Left = 294
Height = 13
Top = 8
Width = 33
Caption = 'Callout'
ParentColor = False
end
end
object cbShape: TComboBox
Left = 336
Left = 412
Height = 21
Top = 32
Width = 160

View File

@ -23,6 +23,7 @@ type
lblAxisAngle: TLabel;
lblSeriesAngle: TLabel;
lblTitleAngle: TLabel;
lblCalloutAngle: TLabel;
pcMain: TPageControl;
pnlControls: TPanel;
RandomChartSource1: TRandomChartSource;
@ -30,11 +31,13 @@ type
seSeriesAngle: TSpinEdit;
seTitleAngle: TSpinEdit;
Multiline: TTabSheet;
seCalloutAngle: TSpinEdit;
tsBar: TTabSheet;
procedure cbHideOverlappingChange(Sender: TObject);
procedure cbShapeChange(Sender: TObject);
procedure ChartMultiAxisList1MarkToText(var AText: String; AMark: Double);
procedure seAxisAngleChange(Sender: TObject);
procedure seCalloutAngleChange(Sender: TObject);
procedure seSeriesAngleChange(Sender: TObject);
procedure seTitleAngleChange(Sender: TObject);
end;
@ -90,6 +93,15 @@ begin
ChartMulti.BottomAxis.Marks.LabelFont.Orientation := seAxisAngle.Value * 10;
end;
procedure TForm1.seCalloutAngleChange(Sender: TObject);
begin
with Chart1BarSeries1.Marks do begin
CalloutAngle := seCalloutAngle.Value * 10;
LinkPen.Visible := seCalloutAngle.Value = 0;
Arrow.Visible := seCalloutAngle.Value = 0;
end;
end;
procedure TForm1.seSeriesAngleChange(Sender: TObject);
begin
Chart1BarSeries1.Marks.LabelFont.Orientation := seSeriesAngle.Value * 10;