TAChart: Add box-and-whiskers series demo

git-svn-id: trunk@27121 -
This commit is contained in:
ask 2010-08-17 10:11:43 +00:00
parent 3e1fdc1102
commit ee758c26c4
2 changed files with 60 additions and 2 deletions

View File

@ -6,6 +6,7 @@ object Form1: TForm1
Caption = 'Form1'
ClientHeight = 373
ClientWidth = 471
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '0.9.29'
object PageControl1: TPageControl
@ -13,9 +14,9 @@ object Form1: TForm1
Height = 373
Top = 0
Width = 471
ActivePage = tsStackedBar
ActivePage = tsWhiskers
Align = alClient
TabIndex = 1
TabIndex = 2
TabOrder = 0
object tsBubble: TTabSheet
Caption = 'Bubble'
@ -93,6 +94,40 @@ object Form1: TForm1
end
end
end
object tsWhiskers: TTabSheet
Caption = 'Box-and-whiskers'
ClientHeight = 347
ClientWidth = 463
object chWhiskers: TChart
Left = 0
Height = 347
Top = 0
Width = 463
AxisList = <
item
Grid.Visible = False
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 = alClient
ParentColor = False
object chWhiskersBoxAndWhiskerSeries1: TBoxAndWhiskerSeries
BoxBrush.Color = clGreen
MedianPen.Color = clLime
MedianPen.Width = 2
WhiskersPen.Color = clBlue
end
end
end
end
object lcsBubble: TListChartSource
DataPoints.Strings = (

View File

@ -13,15 +13,19 @@ type
{ TForm1 }
TForm1 = class(TForm)
chWhiskers: TChart;
chStackedBars: TChart;
chBubble: TChart;
Chart1BubbleSeries1: TBubbleSeries;
chStackedBarsBarSeries1: TBarSeries;
chWhiskersBoxAndWhiskerSeries1: TBoxAndWhiskerSeries;
lcsBubble: TListChartSource;
PageControl1: TPageControl;
rcsStacked: TRandomChartSource;
tsWhiskers: TTabSheet;
tsStackedBar: TTabSheet;
tsBubble: TTabSheet;
procedure FormCreate(Sender: TObject);
end;
var
@ -31,5 +35,24 @@ implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
var
ylist: array [1..4] of Double;
i, j, y: Integer;
begin
chWhiskersBoxAndWhiskerSeries1.ListSource.YCount := 5;
for i := 1 to 6 do begin
y := Random(80) + 10;
chWhiskersBoxAndWhiskerSeries1.AddXY(i, y);
for j := 1 to 4 do begin
y += Random(20) + 5;
ylist[j] := y;
end;
chWhiskersBoxAndWhiskerSeries1.ListSource.SetYList(i - 1, ylist);
end;
end;
end.