TAChart: Add "OHLC" page to the multi demo

git-svn-id: trunk@29890 -
This commit is contained in:
ask 2011-03-17 12:35:08 +00:00
parent a498bbde25
commit a2d747b2c4
4 changed files with 69 additions and 8 deletions

View File

@ -195,6 +195,47 @@ object Form1: TForm1
end
end
end
object tsOHLC: TTabSheet
Caption = 'OHLC'
ClientHeight = 433
ClientWidth = 521
object chOHLC: TChart
Left = 0
Height = 433
Top = 0
Width = 521
AxisList = <
item
Grid.Color = clGray
TickLength = 0
Title.LabelFont.Orientation = 900
end
item
Alignment = calBottom
Grid.Visible = False
end>
ExpandPercentage = 5
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue
Legend.Visible = True
Title.Brush.Color = clBtnFace
Title.Brush.Style = bsClear
Title.Font.Color = clBlack
Title.Font.Style = [fsBold]
Title.Text.Strings = (
'ACME Corporation'
)
Title.Visible = True
Align = alClient
Color = clSkyBlue
ParentColor = False
object chOHLCOpenHighLowCloseSeries1: TOpenHighLowCloseSeries
Title = 'test'
LinePen.EndCap = pecSquare
LinePen.Width = 2
end
end
end
end
object lcsBubble: TListChartSource
DataPoints.Strings = (

View File

@ -15,7 +15,9 @@ type
TForm1 = class(TForm)
ccsStacked: TCalculatedChartSource;
cbPercentage: TCheckBox;
chOHLC: TChart;
ChartStyles1: TChartStyles;
chOHLCOpenHighLowCloseSeries1: TOpenHighLowCloseSeries;
chStackedAreaSeries1: TAreaSeries;
chStackedLineSeries1: TLineSeries;
chWhiskers: TChart;
@ -29,6 +31,7 @@ type
pnStackedControls: TPanel;
rgStackedSeries: TRadioGroup;
rcsStacked: TRandomChartSource;
tsOHLC: TTabSheet;
tsWhiskers: TTabSheet;
tsStacked: TTabSheet;
tsBubble: TTabSheet;
@ -54,7 +57,8 @@ end;
procedure TForm1.FormCreate(Sender: TObject);
var
ylist: array [1..4] of Double;
i, j, y: Integer;
i, j: Integer;
y: Double;
begin
chWhiskersBoxAndWhiskerSeries1.ListSource.YCount := 5;
for i := 1 to 6 do begin
@ -66,6 +70,19 @@ begin
end;
chWhiskersBoxAndWhiskerSeries1.ListSource.SetYList(i - 1, ylist);
end;
chOHLCOpenHighLowCloseSeries1.ListSource.YCount := 4;
y := 50;
for i := 1 to 50 do begin
y += Random(80) / 10 - 4;
chOHLCOpenHighLowCloseSeries1.AddXY(i, y);
ylist[1] := y;
for j := 1 to 3 do begin
ylist[j] += Random(20) / 10 + 1;
ylist[j + 1] := ylist[j];
end;
chOHLCOpenHighLowCloseSeries1.ListSource.SetYList(i - 1, ylist);
end;
end;
procedure TForm1.rgStackedSeriesClick(Sender: TObject);

View File

@ -29,14 +29,18 @@
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<RequiredPackages Count="3">
<Item1>
<PackageName Value="TAChartLazarusPkg"/>
<MinVersion Major="1" Valid="True"/>
<PackageName Value="LCLBase"/>
<MinVersion Major="1" Release="1" Valid="True"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
<PackageName Value="TAChartLazarusPkg"/>
<MinVersion Major="1" Valid="True"/>
</Item2>
<Item3>
<PackageName Value="LCL"/>
</Item3>
</RequiredPackages>
<Units Count="2">
<Unit0>
@ -54,7 +58,7 @@
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="9"/>
<Version Value="10"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="multidemo"/>

View File

@ -7,8 +7,7 @@ uses
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, Main, tachartlazaruspkg
{ you can add units after this };
Forms, Main, tachartlazaruspkg;
{$R *.res}