mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-31 02:52:29 +02:00
TAChart: Update axis demo to include TDateTimeIntervalChartSource component
git-svn-id: trunk@26951 -
This commit is contained in:
parent
2b8839ef40
commit
e9632ff6d5
@ -14,9 +14,9 @@ object Form1: TForm1
|
||||
Height = 333
|
||||
Top = 0
|
||||
Width = 533
|
||||
ActivePage = tsAxisGroup
|
||||
ActivePage = lsLinear
|
||||
Align = alClient
|
||||
TabIndex = 3
|
||||
TabIndex = 0
|
||||
TabOrder = 0
|
||||
object lsLinear: TTabSheet
|
||||
Caption = 'Linear transform'
|
||||
@ -278,6 +278,44 @@ object Form1: TForm1
|
||||
ParentColor = False
|
||||
end
|
||||
end
|
||||
object tsDateTime: TTabSheet
|
||||
Caption = 'Date and time'
|
||||
ClientHeight = 307
|
||||
ClientWidth = 525
|
||||
object ChartDateTime: TChart
|
||||
Left = 0
|
||||
Height = 307
|
||||
Top = 0
|
||||
Width = 525
|
||||
AxisList = <
|
||||
item
|
||||
Title.LabelFont.Orientation = 900
|
||||
Title.Font.Orientation = 900
|
||||
end
|
||||
item
|
||||
Alignment = calBottom
|
||||
Marks.Format = '%2:s'
|
||||
Marks.OverlapPolicy = opHideNeighbour
|
||||
Marks.Source = DateTimeIntervalChartSource1
|
||||
Marks.Style = smsLabel
|
||||
end>
|
||||
Foot.Brush.Color = clBtnFace
|
||||
Foot.Font.Color = clBlue
|
||||
Title.Brush.Color = clBtnFace
|
||||
Title.Font.Color = clBlue
|
||||
Title.Text.Strings = (
|
||||
'This series contain data points for every hour in 10 years'
|
||||
'Zoom in to see various labels on the bottom axis'
|
||||
)
|
||||
Title.Visible = True
|
||||
Align = alClient
|
||||
ParentColor = False
|
||||
object ChartDateTimeLineSeries1: TLineSeries
|
||||
SeriesColor = clBlack
|
||||
Source = rcsDates
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
object lcsMarks: TListChartSource
|
||||
DataPoints.Strings = (
|
||||
@ -339,4 +377,21 @@ object Form1: TForm1
|
||||
Enabled = False
|
||||
end
|
||||
end
|
||||
object rcsDates: TRandomChartSource
|
||||
RandSeed = 1079653020
|
||||
XMax = 0
|
||||
XMin = 0
|
||||
YMax = 50
|
||||
YMin = 5
|
||||
left = 87
|
||||
top = 216
|
||||
end
|
||||
object ChartToolsetDateTime: TChartToolset
|
||||
left = 352
|
||||
top = 172
|
||||
end
|
||||
object DateTimeIntervalChartSource1: TDateTimeIntervalChartSource
|
||||
left = 352
|
||||
top = 232
|
||||
end
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ interface
|
||||
|
||||
uses
|
||||
ComCtrls, ExtCtrls, Forms, StdCtrls, TAGraph, TASeries, TASources,
|
||||
TATransformations, Classes;
|
||||
TATools, TATransformations;
|
||||
|
||||
type
|
||||
|
||||
@ -17,10 +17,13 @@ type
|
||||
catTAutoScaleAxisTransform1: TAutoScaleAxisTransform;
|
||||
catTAuto: TChartAxisTransformations;
|
||||
cbAuto: TCheckBox;
|
||||
ChartDateTime: TChart;
|
||||
ChartAxisGroup: TChart;
|
||||
ChartDateTimeLineSeries1: TLineSeries;
|
||||
ChartLog: TChart;
|
||||
cfsLog: TFuncSeries;
|
||||
cbLog: TCheckBox;
|
||||
ChartToolsetDateTime: TChartToolset;
|
||||
ChartTWinterBar: TBarSeries;
|
||||
clsLogPoints: TLineSeries;
|
||||
ChartT: TChart;
|
||||
@ -33,13 +36,16 @@ type
|
||||
ChartCustomMarksBarSeries1: TBarSeries;
|
||||
ChartTSummer: TLineSeries;
|
||||
ChartTWinterLine: TLineSeries;
|
||||
DateTimeIntervalChartSource1: TDateTimeIntervalChartSource;
|
||||
lcsMarks: TListChartSource;
|
||||
PageControl1: TPageControl;
|
||||
pnlLogControls: TPanel;
|
||||
pnlAutoControls: TPanel;
|
||||
rcsDates: TRandomChartSource;
|
||||
rcsTSummer: TRandomChartSource;
|
||||
rcsTWinter: TRandomChartSource;
|
||||
lsLinear: TTabSheet;
|
||||
tsDateTime: TTabSheet;
|
||||
tsAxisGroup: TTabSheet;
|
||||
tsLog: TTabSheet;
|
||||
tsCustomMarks: TTabSheet;
|
||||
@ -56,7 +62,7 @@ var
|
||||
implementation
|
||||
|
||||
uses
|
||||
Math, TAChartAxis;
|
||||
Math, SysUtils, TAChartAxis, TAChartUtils;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
@ -121,6 +127,11 @@ begin
|
||||
end;
|
||||
ls.AxisIndexY := ChartAxisGroup.AxisList.Count - 1;
|
||||
end;
|
||||
with rcsDates do begin
|
||||
XMin := Now - 5 * 365;
|
||||
XMax := Now + 5 * 365;
|
||||
PointsNumber := 10 * 365 * 24;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.TChartAxisList1MarkToText(var AText: String; AMark: Double);
|
||||
|
Loading…
Reference in New Issue
Block a user