mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 13:39:24 +02:00
TAChart: Update navigation demo
git-svn-id: trunk@29941 -
This commit is contained in:
parent
dcc462fe9b
commit
38f52e6892
@ -1,18 +1,19 @@
|
|||||||
object Form1: TForm1
|
object Form1: TForm1
|
||||||
Left = 1348
|
Left = 1346
|
||||||
Height = 298
|
Height = 351
|
||||||
Top = 187
|
Top = 187
|
||||||
Width = 355
|
Width = 479
|
||||||
Caption = 'Form1'
|
Caption = 'Form1'
|
||||||
ClientHeight = 298
|
ClientHeight = 351
|
||||||
ClientWidth = 355
|
ClientWidth = 479
|
||||||
|
OnCreate = FormCreate
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '0.9.31'
|
LCLVersion = '0.9.31'
|
||||||
object Chart1: TChart
|
object Chart1: TChart
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 262
|
Height = 249
|
||||||
Top = 0
|
Top = 66
|
||||||
Width = 339
|
Width = 463
|
||||||
AxisList = <
|
AxisList = <
|
||||||
item
|
item
|
||||||
Title.LabelFont.Orientation = 900
|
Title.LabelFont.Orientation = 900
|
||||||
@ -22,13 +23,18 @@ object Form1: TForm1
|
|||||||
end>
|
end>
|
||||||
Foot.Brush.Color = clBtnFace
|
Foot.Brush.Color = clBtnFace
|
||||||
Foot.Font.Color = clBlue
|
Foot.Font.Color = clBlue
|
||||||
|
Frame.Visible = False
|
||||||
|
Margins.Left = 1
|
||||||
|
Margins.Top = 1
|
||||||
|
Margins.Right = 1
|
||||||
|
Margins.Bottom = 1
|
||||||
|
Proportional = True
|
||||||
Title.Brush.Color = clBtnFace
|
Title.Brush.Color = clBtnFace
|
||||||
Title.Font.Color = clBlue
|
Title.Font.Color = clBlue
|
||||||
Title.Text.Strings = (
|
Title.Text.Strings = (
|
||||||
'TAChart'
|
'TAChart'
|
||||||
)
|
)
|
||||||
Toolset = ChartToolset1
|
Toolset = ChartToolset1
|
||||||
OnExtentChanged = Chart1ExtentChanged
|
|
||||||
Align = alClient
|
Align = alClient
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
object Chart1LineSeries1: TLineSeries
|
object Chart1LineSeries1: TLineSeries
|
||||||
@ -38,8 +44,8 @@ object Form1: TForm1
|
|||||||
object StatusBar1: TStatusBar
|
object StatusBar1: TStatusBar
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 20
|
Height = 20
|
||||||
Top = 278
|
Top = 331
|
||||||
Width = 355
|
Width = 479
|
||||||
Panels = <
|
Panels = <
|
||||||
item
|
item
|
||||||
Width = 50
|
Width = 50
|
||||||
@ -47,9 +53,9 @@ object Form1: TForm1
|
|||||||
SimplePanel = False
|
SimplePanel = False
|
||||||
end
|
end
|
||||||
object sbChartVert: TChartNavScrollBar
|
object sbChartVert: TChartNavScrollBar
|
||||||
Left = 339
|
Left = 463
|
||||||
Height = 262
|
Height = 249
|
||||||
Top = 0
|
Top = 66
|
||||||
Width = 16
|
Width = 16
|
||||||
Chart = Chart1
|
Chart = Chart1
|
||||||
Align = alRight
|
Align = alRight
|
||||||
@ -61,8 +67,8 @@ object Form1: TForm1
|
|||||||
object sbChartHor: TChartNavScrollBar
|
object sbChartHor: TChartNavScrollBar
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 16
|
Height = 16
|
||||||
Top = 262
|
Top = 315
|
||||||
Width = 339
|
Width = 463
|
||||||
AutoPageSize = True
|
AutoPageSize = True
|
||||||
Chart = Chart1
|
Chart = Chart1
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
@ -70,10 +76,53 @@ object Form1: TForm1
|
|||||||
PageSize = 0
|
PageSize = 0
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
end
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Height = 66
|
||||||
|
Top = 0
|
||||||
|
Width = 479
|
||||||
|
Align = alTop
|
||||||
|
Anchors = [akTop, akRight]
|
||||||
|
ClientHeight = 66
|
||||||
|
ClientWidth = 479
|
||||||
|
TabOrder = 4
|
||||||
|
object StaticText1: TStaticText
|
||||||
|
AnchorSideRight.Control = ChartNavPanel1
|
||||||
|
Left = 8
|
||||||
|
Height = 31
|
||||||
|
Top = 4
|
||||||
|
Width = 245
|
||||||
|
Caption = 'Left-drag to zoom,'#13#10'right-drag on both map and navpanel to pan'
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object ChartNavPanel1: TChartNavPanel
|
||||||
|
Cursor = crCross
|
||||||
|
Left = 340
|
||||||
|
Height = 64
|
||||||
|
Top = 1
|
||||||
|
Width = 138
|
||||||
|
Chart = Chart1
|
||||||
|
FullExtentPen.Color = clGreen
|
||||||
|
FullExtentPen.Style = psDot
|
||||||
|
LogicalExtentPen.Color = clBlue
|
||||||
|
Proportional = True
|
||||||
|
Shift = [ssRight]
|
||||||
|
Align = alRight
|
||||||
|
end
|
||||||
|
object cbMiniMap: TCheckBox
|
||||||
|
Left = 8
|
||||||
|
Height = 17
|
||||||
|
Top = 44
|
||||||
|
Width = 62
|
||||||
|
Caption = 'Mini-map'
|
||||||
|
OnChange = cbMiniMapChange
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
object RandomChartSource1: TRandomChartSource
|
object RandomChartSource1: TRandomChartSource
|
||||||
PointsNumber = 100
|
PointsNumber = 150
|
||||||
RandSeed = 909742449
|
RandSeed = 909742449
|
||||||
XMax = 100
|
XMax = 150
|
||||||
XMin = 1
|
XMin = 1
|
||||||
YMax = 80
|
YMax = 80
|
||||||
YMin = 10
|
YMin = 10
|
||||||
|
@ -5,8 +5,8 @@ unit Main;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
ComCtrls, SysUtils, Forms, TAGraph, TASeries, TASources, TANavigation,
|
ComCtrls, ExtCtrls, StdCtrls, SysUtils, Forms, TAGraph, TASeries, TASources,
|
||||||
TATools;
|
TANavigation, TATools, Classes;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -15,14 +15,20 @@ type
|
|||||||
TForm1 = class(TForm)
|
TForm1 = class(TForm)
|
||||||
Chart1: TChart;
|
Chart1: TChart;
|
||||||
Chart1LineSeries1: TLineSeries;
|
Chart1LineSeries1: TLineSeries;
|
||||||
|
ChartNavPanel1: TChartNavPanel;
|
||||||
ChartToolset1: TChartToolset;
|
ChartToolset1: TChartToolset;
|
||||||
ChartToolset1PanDragTool1: TPanDragTool;
|
ChartToolset1PanDragTool1: TPanDragTool;
|
||||||
ChartToolset1ZoomDragTool1: TZoomDragTool;
|
ChartToolset1ZoomDragTool1: TZoomDragTool;
|
||||||
|
cbMiniMap: TCheckBox;
|
||||||
|
Panel1: TPanel;
|
||||||
RandomChartSource1: TRandomChartSource;
|
RandomChartSource1: TRandomChartSource;
|
||||||
sbChartHor: TChartNavScrollBar;
|
sbChartHor: TChartNavScrollBar;
|
||||||
sbChartVert: TChartNavScrollBar;
|
sbChartVert: TChartNavScrollBar;
|
||||||
|
StaticText1: TStaticText;
|
||||||
StatusBar1: TStatusBar;
|
StatusBar1: TStatusBar;
|
||||||
|
procedure cbMiniMapChange(Sender: TObject);
|
||||||
procedure Chart1ExtentChanged(ASender: TChart);
|
procedure Chart1ExtentChanged(ASender: TChart);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -34,6 +40,11 @@ implementation
|
|||||||
|
|
||||||
{ TForm1 }
|
{ TForm1 }
|
||||||
|
|
||||||
|
procedure TForm1.cbMiniMapChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ChartNavPanel1.MiniMap := cbMiniMap.Checked;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TForm1.Chart1ExtentChanged(ASender: TChart);
|
procedure TForm1.Chart1ExtentChanged(ASender: TChart);
|
||||||
begin
|
begin
|
||||||
with ASender.LogicalExtent do
|
with ASender.LogicalExtent do
|
||||||
@ -41,5 +52,10 @@ begin
|
|||||||
Format('(%.3g;%.3g) - (%.3g;%.3g)', [a.X, a.Y, b.X, b.Y]);
|
Format('(%.3g;%.3g) - (%.3g;%.3g)', [a.X, a.Y, b.X, b.Y]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Chart1.OnExtentChanged := @Chart1ExtentChanged;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user