mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 17:39:18 +02:00
TAChart: Improved "basic" project in "demo" folder
git-svn-id: trunk@63690 -
This commit is contained in:
parent
c1d49b5369
commit
5e929bb85f
@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="11"/>
|
||||
<Version Value="12"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<LRSInOutputDirectory Value="False"/>
|
||||
<CompatibilityMode Value="True"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="TChart basic demo"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
@ -25,11 +25,14 @@
|
||||
<DestinationDirectory Value="$(TestDir)\publishedproject\"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||
</local>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="1">
|
||||
<Mode0 Name="default">
|
||||
<local>
|
||||
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||
<LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
|
||||
</local>
|
||||
</Mode0>
|
||||
</Modes>
|
||||
@ -74,10 +77,6 @@
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsStabs"/>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<Win32>
|
||||
|
@ -13,7 +13,7 @@ uses
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Title := 'TChart basic demo';
|
||||
Application.Title:='TChart basic demo';
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
|
@ -10,7 +10,7 @@ object Form1: TForm1
|
||||
LCLVersion = '2.1.0.0'
|
||||
object Chart1: TChart
|
||||
Left = 0
|
||||
Height = 374
|
||||
Height = 372
|
||||
Top = 0
|
||||
Width = 610
|
||||
AntialiasingMode = amOn
|
||||
@ -52,23 +52,21 @@ object Form1: TForm1
|
||||
object Chart1LineHor: TConstantLine
|
||||
Legend.Visible = False
|
||||
Pen.Style = psDash
|
||||
Position = 0
|
||||
end
|
||||
object Chart1LineVert: TConstantLine
|
||||
Legend.Visible = False
|
||||
LineStyle = lsVertical
|
||||
Pen.Style = psDash
|
||||
Position = 0
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Height = 120
|
||||
Top = 374
|
||||
Height = 122
|
||||
Top = 372
|
||||
Width = 610
|
||||
Align = alBottom
|
||||
AutoSize = True
|
||||
ClientHeight = 120
|
||||
ClientHeight = 122
|
||||
ClientWidth = 610
|
||||
TabOrder = 0
|
||||
object lblAdd: TLabel
|
||||
@ -114,7 +112,7 @@ object Form1: TForm1
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 47
|
||||
Height = 15
|
||||
Top = 92
|
||||
Top = 94
|
||||
Width = 86
|
||||
Caption = 'Add with marks:'
|
||||
ParentColor = False
|
||||
@ -189,7 +187,7 @@ object Form1: TForm1
|
||||
Left = 424
|
||||
Height = 19
|
||||
Top = 27
|
||||
Width = 84
|
||||
Width = 85
|
||||
Caption = 'Bottom Axis'
|
||||
Checked = True
|
||||
OnChange = cbBottomAxisChange
|
||||
@ -203,7 +201,7 @@ object Form1: TForm1
|
||||
Left = 424
|
||||
Height = 19
|
||||
Top = 46
|
||||
Width = 64
|
||||
Width = 65
|
||||
Caption = 'Left Axis'
|
||||
Checked = True
|
||||
OnChange = cbLeftAxisChange
|
||||
@ -213,10 +211,10 @@ object Form1: TForm1
|
||||
object cbTitle: TCheckBox
|
||||
AnchorSideLeft.Control = cbFooter
|
||||
AnchorSideTop.Control = cbLegend
|
||||
Left = 516
|
||||
Left = 517
|
||||
Height = 19
|
||||
Top = 8
|
||||
Width = 43
|
||||
Width = 42
|
||||
BorderSpacing.Right = 8
|
||||
Caption = 'Title'
|
||||
Checked = True
|
||||
@ -229,7 +227,7 @@ object Form1: TForm1
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = cbLegend
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 516
|
||||
Left = 517
|
||||
Height = 19
|
||||
Top = 27
|
||||
Width = 54
|
||||
@ -243,7 +241,7 @@ object Form1: TForm1
|
||||
AnchorSideLeft.Control = cbFooter
|
||||
AnchorSideTop.Control = cbFooter
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 516
|
||||
Left = 517
|
||||
Height = 19
|
||||
Top = 46
|
||||
Width = 63
|
||||
@ -342,10 +340,10 @@ object Form1: TForm1
|
||||
AnchorSideLeft.Control = cbFooter
|
||||
AnchorSideTop.Control = cbInverted
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 516
|
||||
Left = 517
|
||||
Height = 19
|
||||
Top = 65
|
||||
Width = 69
|
||||
Width = 70
|
||||
BorderSpacing.Right = 8
|
||||
Caption = 'Axis titles'
|
||||
OnChange = cbShowAxisTitlesChange
|
||||
@ -354,9 +352,10 @@ object Form1: TForm1
|
||||
object cbMarkStyle: TComboBox
|
||||
AnchorSideLeft.Control = lblMarkStyle
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = cbCrosshairTool
|
||||
Left = 141
|
||||
Height = 23
|
||||
Top = 88
|
||||
Top = 90
|
||||
Width = 136
|
||||
BorderSpacing.Left = 8
|
||||
BorderSpacing.Bottom = 8
|
||||
@ -394,12 +393,12 @@ object Form1: TForm1
|
||||
TabOrder = 18
|
||||
end
|
||||
object lblCrossHairTool: TLabel
|
||||
AnchorSideTop.Control = lblMarkStyle
|
||||
AnchorSideTop.Control = cbCrosshairTool
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = cbCrosshairTool
|
||||
Left = 340
|
||||
Height = 15
|
||||
Top = 92
|
||||
Top = 94
|
||||
Width = 76
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Right = 8
|
||||
@ -408,10 +407,13 @@ object Form1: TForm1
|
||||
end
|
||||
object cbCrosshairTool: TComboBox
|
||||
AnchorSideLeft.Control = cbShowGridCheckBox
|
||||
AnchorSideTop.Control = cbShowGridCheckBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 424
|
||||
Height = 23
|
||||
Top = 88
|
||||
Top = 90
|
||||
Width = 155
|
||||
BorderSpacing.Top = 6
|
||||
ItemHeight = 15
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
@ -427,8 +429,8 @@ object Form1: TForm1
|
||||
end
|
||||
end
|
||||
object ChartToolset1: TChartToolset
|
||||
left = 240
|
||||
top = 115
|
||||
Left = 240
|
||||
Top = 115
|
||||
object DataPointCrosshairTool: TDataPointCrosshairTool
|
||||
end
|
||||
end
|
||||
|
@ -82,7 +82,7 @@ implementation
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
Math, TAChartUtils, TATextElements, TATypes;
|
||||
Math, GraphUtil, TAChartUtils, TATextElements, TATypes;
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
@ -106,7 +106,7 @@ begin
|
||||
if random(2) >= 0.7 then Y3 := Y3 + random(5)
|
||||
else if random(2) >= 0.7 then Y3 := 0
|
||||
else Y3 := Y3 - random(5);
|
||||
FArea.AddXY(x3, y3, '', clTAColor);
|
||||
FArea.AddXY(x3, y3, Format('Area%d', [i]));
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -118,7 +118,7 @@ begin
|
||||
BringToFront(FBar);
|
||||
FBar.Marks.Style := TSeriesMarksStyle(cbMarkStyle.ItemIndex);
|
||||
for i := 1 to edAddCount.Value do begin
|
||||
FBar.AddXY(x, y, '', clBlue * (i mod 2) + clTAColor * (1 - i mod 2));
|
||||
FBar.AddXY(x, y, Format('Bar%d', [i]));
|
||||
X := X + 1;
|
||||
if random(2) >= 0.7 then Y := Y + random(5)
|
||||
else if random(2) >= 0.7 then Y := 0
|
||||
@ -134,7 +134,7 @@ begin
|
||||
BringToFront(FLine);
|
||||
FLine.Marks.Style := TSeriesMarksStyle(cbMarkStyle.ItemIndex);
|
||||
for i := 1 to edAddCount.Value do begin
|
||||
FLine.AddXY(x1, y1, '', IfThen(i mod 2 = 0, clGreen, clBlue));
|
||||
FLine.AddXY(x1, y1, Format('Line%d', [i]));
|
||||
X1 := X1 + 1.5;
|
||||
if random(2) >= 0.5 then Y1 := Y1 + random(10)
|
||||
else Y1 := Y1 - random(5);
|
||||
@ -254,6 +254,7 @@ begin
|
||||
FArea := TAreaSeries.Create(Chart1);
|
||||
FArea.SeriesColor := clFuchsia;
|
||||
FArea.Title := 'area';
|
||||
FArea.Marks.LabelBrush.Color := GetHighlightColor(FArea.SeriesColor, 100);
|
||||
Chart1.AddSeries(FArea);
|
||||
end;
|
||||
|
||||
@ -261,7 +262,8 @@ procedure TForm1.InitBar;
|
||||
begin
|
||||
FBar := TBarSeries.Create(Chart1);
|
||||
FBar.Title := 'bars';
|
||||
FBar.SeriesColor := clGreen;
|
||||
FBar.BarBrush.Color := clGreen;
|
||||
FBar.Marks.LabelBrush.Color := GetHighlightColor(FBar.BarBrush.Color, 100);
|
||||
Chart1.AddSeries(FBar);
|
||||
end;
|
||||
|
||||
@ -274,6 +276,7 @@ begin
|
||||
FLine.Pointer.Brush.Color := clRed;
|
||||
FLine.Title := 'line';
|
||||
FLine.SeriesColor := clRed;
|
||||
FLine.Marks.LabelBrush.Color := GetHighlightColor(FLine.SeriesColor, 100);
|
||||
Chart1.AddSeries(FLine);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user