mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 02:39:23 +02:00
TAChart: Add rotated function series to the demo
git-svn-id: trunk@29092 -
This commit is contained in:
parent
2429f7c9cf
commit
8033e87029
@ -13,9 +13,9 @@ object Form1: TForm1
|
|||||||
Height = 362
|
Height = 362
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 461
|
Width = 461
|
||||||
ActivePage = tsColorMap
|
ActivePage = tsDomain
|
||||||
Align = alClient
|
Align = alClient
|
||||||
TabIndex = 1
|
TabIndex = 0
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object tsDomain: TTabSheet
|
object tsDomain: TTabSheet
|
||||||
Caption = 'Domain'
|
Caption = 'Domain'
|
||||||
@ -50,8 +50,11 @@ object Form1: TForm1
|
|||||||
ParentColor = False
|
ParentColor = False
|
||||||
object Chart1FuncSeries1: TFuncSeries
|
object Chart1FuncSeries1: TFuncSeries
|
||||||
Extent.XMin = -6.28
|
Extent.XMin = -6.28
|
||||||
|
Extent.YMin = -2
|
||||||
Extent.XMax = 6.28
|
Extent.XMax = 6.28
|
||||||
|
Extent.YMax = 2
|
||||||
Extent.UseXMin = True
|
Extent.UseXMin = True
|
||||||
|
Extent.UseYMin = True
|
||||||
Extent.UseXMax = True
|
Extent.UseXMax = True
|
||||||
Title = '1 / Sin(x)'
|
Title = '1 / Sin(x)'
|
||||||
OnCalculate = Chart1FuncSeries1Calculate
|
OnCalculate = Chart1FuncSeries1Calculate
|
||||||
@ -89,6 +92,16 @@ object Form1: TForm1
|
|||||||
OnChange = cbDomainChange
|
OnChange = cbDomainChange
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
|
object cbRotate: TCheckBox
|
||||||
|
Left = 388
|
||||||
|
Height = 17
|
||||||
|
Top = 274
|
||||||
|
Width = 53
|
||||||
|
Anchors = [akRight, akBottom]
|
||||||
|
Caption = 'Rotate'
|
||||||
|
OnChange = cbRotateChange
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object tsColorMap: TTabSheet
|
object tsColorMap: TTabSheet
|
||||||
Caption = 'Color map'
|
Caption = 'Color map'
|
||||||
|
@ -14,6 +14,7 @@ type
|
|||||||
|
|
||||||
TForm1 = class(TForm)
|
TForm1 = class(TForm)
|
||||||
cbDomain: TCheckBox;
|
cbDomain: TCheckBox;
|
||||||
|
cbRotate: TCheckBox;
|
||||||
cbInterpolate: TCheckBox;
|
cbInterpolate: TCheckBox;
|
||||||
cbMultLegend: TCheckBox;
|
cbMultLegend: TCheckBox;
|
||||||
Chart1: TChart;
|
Chart1: TChart;
|
||||||
@ -38,6 +39,7 @@ type
|
|||||||
procedure cbDomainChange(Sender: TObject);
|
procedure cbDomainChange(Sender: TObject);
|
||||||
procedure cbInterpolateChange(Sender: TObject);
|
procedure cbInterpolateChange(Sender: TObject);
|
||||||
procedure cbMultLegendChange(Sender: TObject);
|
procedure cbMultLegendChange(Sender: TObject);
|
||||||
|
procedure cbRotateChange(Sender: TObject);
|
||||||
procedure Chart1FuncSeries1Calculate(const AX: Double; out AY: Double);
|
procedure Chart1FuncSeries1Calculate(const AX: Double; out AY: Double);
|
||||||
procedure Chart1UserDrawnSeries1Draw(ACanvas: TCanvas; const ARect: TRect);
|
procedure Chart1UserDrawnSeries1Draw(ACanvas: TCanvas; const ARect: TRect);
|
||||||
procedure ChartColorMapColorMapSeries1Calculate(const AX, AY: Double; out
|
procedure ChartColorMapColorMapSeries1Calculate(const AX, AY: Double; out
|
||||||
@ -86,6 +88,19 @@ begin
|
|||||||
Multiplicity := lmSingle;
|
Multiplicity := lmSingle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.cbRotateChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
with Chart1FuncSeries1 do
|
||||||
|
if cbRotate.Checked then begin
|
||||||
|
AxisIndexX := 0;
|
||||||
|
AxisIndexY := 1;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
AxisIndexX := 1;
|
||||||
|
AxisIndexY := 0;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TForm1.Chart1FuncSeries1Calculate(const AX: Double; out AY: Double);
|
procedure TForm1.Chart1FuncSeries1Calculate(const AX: Double; out AY: Double);
|
||||||
begin
|
begin
|
||||||
AY := 1 / Sin(AX);
|
AY := 1 / Sin(AX);
|
||||||
|
Loading…
Reference in New Issue
Block a user