mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 19:02:31 +02:00
TAChart: Add TChart.Proportional property
git-svn-id: trunk@27069 -
This commit is contained in:
parent
2fd8c5370e
commit
31fc5cd0a0
@ -166,6 +166,7 @@ type
|
|||||||
FCurrentExtent: TDoubleRect;
|
FCurrentExtent: TDoubleRect;
|
||||||
FIsZoomed: Boolean;
|
FIsZoomed: Boolean;
|
||||||
FOffset: TDoublePoint; // Coordinates transformation
|
FOffset: TDoublePoint; // Coordinates transformation
|
||||||
|
FProportional: Boolean;
|
||||||
FReticuleMode: TReticuleMode;
|
FReticuleMode: TReticuleMode;
|
||||||
FReticulePos: TPoint;
|
FReticulePos: TPoint;
|
||||||
FScale: TDoublePoint; // Coordinates transformation
|
FScale: TDoublePoint; // Coordinates transformation
|
||||||
@ -193,6 +194,7 @@ type
|
|||||||
procedure SetLegend(Value: TChartLegend);
|
procedure SetLegend(Value: TChartLegend);
|
||||||
procedure SetLogicalExtent(const AValue: TDoubleRect);
|
procedure SetLogicalExtent(const AValue: TDoubleRect);
|
||||||
procedure SetMargins(AValue: TChartMargins);
|
procedure SetMargins(AValue: TChartMargins);
|
||||||
|
procedure SetProportional(AValue: Boolean);
|
||||||
procedure SetReticuleMode(const AValue: TReticuleMode);
|
procedure SetReticuleMode(const AValue: TReticuleMode);
|
||||||
procedure SetReticulePos(const AValue: TPoint);
|
procedure SetReticulePos(const AValue: TPoint);
|
||||||
procedure SetTitle(Value: TChartTitle);
|
procedure SetTitle(Value: TChartTitle);
|
||||||
@ -279,6 +281,8 @@ type
|
|||||||
property LeftAxis: TChartAxis index 2 read GetAxis write SetAxis stored false;
|
property LeftAxis: TChartAxis index 2 read GetAxis write SetAxis stored false;
|
||||||
property Legend: TChartLegend read FLegend write SetLegend;
|
property Legend: TChartLegend read FLegend write SetLegend;
|
||||||
property Margins: TChartMargins read FMargins write SetMargins;
|
property Margins: TChartMargins read FMargins write SetMargins;
|
||||||
|
property Proportional: Boolean
|
||||||
|
read FProportional write SetProportional default false;
|
||||||
property ReticuleMode: TReticuleMode
|
property ReticuleMode: TReticuleMode
|
||||||
read FReticuleMode write SetReticuleMode default rmNone;
|
read FReticuleMode write SetReticuleMode default rmNone;
|
||||||
property Series: TChartSeriesList read FSeries;
|
property Series: TChartSeriesList read FSeries;
|
||||||
@ -532,6 +536,12 @@ begin
|
|||||||
@FCurrentExtent.a.Y, @FCurrentExtent.b.Y);
|
@FCurrentExtent.a.Y, @FCurrentExtent.b.Y);
|
||||||
FScale.X := rX.CalcScale(1);
|
FScale.X := rX.CalcScale(1);
|
||||||
FScale.Y := rY.CalcScale(-1);
|
FScale.Y := rY.CalcScale(-1);
|
||||||
|
if Proportional then begin
|
||||||
|
if FScale.X > FScale.Y then
|
||||||
|
FScale.X := FScale.Y
|
||||||
|
else
|
||||||
|
FScale.Y := FScale.Y;
|
||||||
|
end;
|
||||||
FOffset.X := rX.CalcOffset(FScale.X);
|
FOffset.X := rX.CalcOffset(FScale.X);
|
||||||
FOffset.Y := rY.CalcOffset(FScale.Y);
|
FOffset.Y := rY.CalcOffset(FScale.Y);
|
||||||
rX.UpdateMinMax(@XImageToGraph);
|
rX.UpdateMinMax(@XImageToGraph);
|
||||||
@ -903,6 +913,13 @@ begin
|
|||||||
Invalidate;
|
Invalidate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TChart.SetProportional(AValue: Boolean);
|
||||||
|
begin
|
||||||
|
if FProportional = AValue then exit;
|
||||||
|
FProportional := AValue;
|
||||||
|
Invalidate;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TChart.SetChildOrder(Child: TComponent; Order: Integer);
|
procedure TChart.SetChildOrder(Child: TComponent; Order: Integer);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user