mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-19 02:41:10 +02:00
TAChart: Add tools for more realistic performance testing
git-svn-id: trunk@25925 -
This commit is contained in:
parent
252e281d13
commit
72131e1b79
@ -37,7 +37,7 @@ object Form1: TForm1
|
||||
Text = 'Previous'
|
||||
end
|
||||
object cb3D: TCheckBox
|
||||
Left = 152
|
||||
Left = 136
|
||||
Height = 17
|
||||
Top = 12
|
||||
Width = 33
|
||||
@ -46,7 +46,7 @@ object Form1: TForm1
|
||||
TabOrder = 1
|
||||
end
|
||||
object cbRotated: TCheckBox
|
||||
Left = 208
|
||||
Left = 176
|
||||
Height = 17
|
||||
Top = 12
|
||||
Width = 59
|
||||
@ -55,7 +55,7 @@ object Form1: TForm1
|
||||
TabOrder = 2
|
||||
end
|
||||
object btnAddSeries: TButton
|
||||
Left = 284
|
||||
Left = 296
|
||||
Height = 25
|
||||
Top = 8
|
||||
Width = 75
|
||||
@ -80,6 +80,15 @@ object Form1: TForm1
|
||||
OnClick = btnRefreshClick
|
||||
TabOrder = 5
|
||||
end
|
||||
object cbSorted: TCheckBox
|
||||
Left = 240
|
||||
Height = 17
|
||||
Top = 12
|
||||
Width = 52
|
||||
Caption = 'Sorted'
|
||||
OnChange = cbSortedChange
|
||||
TabOrder = 6
|
||||
end
|
||||
end
|
||||
object Chart1: TChart
|
||||
Left = 0
|
||||
@ -101,6 +110,7 @@ object Form1: TForm1
|
||||
Title.Text.Strings = (
|
||||
'TAChart'
|
||||
)
|
||||
Toolset = ChartToolset1
|
||||
Align = alClient
|
||||
DoubleBuffered = True
|
||||
ParentColor = False
|
||||
@ -110,6 +120,14 @@ object Form1: TForm1
|
||||
SeriesColor = clTeal
|
||||
Source = RandomChartSource1
|
||||
end
|
||||
object Chart1ConstantLine1: TConstantLine
|
||||
LineStyle = lsVertical
|
||||
Pen.Color = clAqua
|
||||
Pen.Width = 2
|
||||
Position = 0
|
||||
SeriesColor = clAqua
|
||||
ZPosition = 1
|
||||
end
|
||||
end
|
||||
object RandomChartSource1: TRandomChartSource
|
||||
PointsNumber = 15
|
||||
@ -121,4 +139,18 @@ object Form1: TForm1
|
||||
left = 464
|
||||
top = 208
|
||||
end
|
||||
object ChartToolset1: TChartToolset
|
||||
left = 464
|
||||
top = 272
|
||||
object ChartToolset1DataPointDragTool1: TDataPointDragTool
|
||||
Shift = [ssLeft]
|
||||
AffectedSeries = '1'
|
||||
end
|
||||
object ChartToolset1ZoomDragTool1: TZoomDragTool
|
||||
Shift = [ssShift, ssLeft]
|
||||
end
|
||||
object ChartToolset1PanDragTool1: TPanDragTool
|
||||
Shift = [ssRight]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, ExtCtrls, StdCtrls, SysUtils, FileUtil, Forms, Controls, Graphics,
|
||||
Dialogs, TAGraph, TASeries, TASources;
|
||||
Dialogs, TAGraph, TASeries, TASources, TATools;
|
||||
|
||||
type
|
||||
|
||||
@ -18,8 +18,14 @@ type
|
||||
cb3D: TCheckBox;
|
||||
cbLineType: TComboBox;
|
||||
cbRotated: TCheckBox;
|
||||
cbSorted: TCheckBox;
|
||||
Chart1: TChart;
|
||||
Chart1ConstantLine1: TConstantLine;
|
||||
Chart1LineSeries1: TLineSeries;
|
||||
ChartToolset1: TChartToolset;
|
||||
ChartToolset1DataPointDragTool1: TDataPointDragTool;
|
||||
ChartToolset1PanDragTool1: TPanDragTool;
|
||||
ChartToolset1ZoomDragTool1: TZoomDragTool;
|
||||
edTime: TEdit;
|
||||
Panel1: TPanel;
|
||||
RandomChartSource1: TRandomChartSource;
|
||||
@ -28,6 +34,7 @@ type
|
||||
procedure cb3DChange(Sender: TObject);
|
||||
procedure cbLineTypeChange(Sender: TObject);
|
||||
procedure cbRotatedChange(Sender: TObject);
|
||||
procedure cbSortedChange(Sender: TObject);
|
||||
end;
|
||||
|
||||
var
|
||||
@ -70,8 +77,9 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
for i := 0 to Chart1.SeriesCount - 1 do
|
||||
with Chart1.Series[i] as TLineSeries do
|
||||
Depth := 15 - Depth;
|
||||
if Chart1.Series[i] is TLineSeries then
|
||||
with Chart1.Series[i] as TLineSeries do
|
||||
Depth := 15 - Depth;
|
||||
end;
|
||||
|
||||
procedure TForm1.cbLineTypeChange(Sender: TObject);
|
||||
@ -79,7 +87,9 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
for i := 0 to Chart1.SeriesCount - 1 do
|
||||
(Chart1.Series[i] as TLineSeries).LineType := TLineType(cbLineType.ItemIndex);
|
||||
if Chart1.Series[i] is TLineSeries then
|
||||
with Chart1.Series[i] as TLineSeries do
|
||||
LineType := TLineType(cbLineType.ItemIndex);
|
||||
end;
|
||||
|
||||
procedure TForm1.cbRotatedChange(Sender: TObject);
|
||||
@ -87,10 +97,22 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
for i := 0 to Chart1.SeriesCount - 1 do
|
||||
with Chart1.Series[i] as TLineSeries do begin
|
||||
AxisIndexY := Ord(cbRotated.Checked);
|
||||
AxisIndexX := 1 - AxisIndexY;
|
||||
end;
|
||||
if Chart1.Series[i] is TLineSeries then
|
||||
with Chart1.Series[i] as TLineSeries do begin
|
||||
AxisIndexY := Ord(cbRotated.Checked);
|
||||
AxisIndexX := 1 - AxisIndexY;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.cbSortedChange(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
for i := 0 to Chart1.SeriesCount - 1 do
|
||||
if Chart1.Series[i] is TLineSeries then
|
||||
with Chart1.Series[i] as TLineSeries do
|
||||
if Source is TListChartSource then
|
||||
ListSource.Sorted := cbSorted.Checked;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user