mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 17:19:23 +02:00
TAChart: Add TChartMarks.AutoMargins property
git-svn-id: trunk@39187 -
This commit is contained in:
parent
74b95eaefd
commit
362d125f5b
@ -1189,7 +1189,7 @@ var
|
|||||||
dir: TLabelDirection;
|
dir: TLabelDirection;
|
||||||
m: array [TLabelDirection] of Integer absolute AMargins;
|
m: array [TLabelDirection] of Integer absolute AMargins;
|
||||||
begin
|
begin
|
||||||
if not Marks.IsMarkLabelsVisible then exit;
|
if not Marks.IsMarkLabelsVisible or not Marks.AutoMargins then exit;
|
||||||
|
|
||||||
for i := 0 to Count - 1 do begin
|
for i := 0 to Count - 1 do begin
|
||||||
if not ParentChart.IsPointInViewPort(GetGraphPoint(i)) then continue;
|
if not ParentChart.IsPointInViewPort(GetGraphPoint(i)) then continue;
|
||||||
|
@ -169,11 +169,13 @@ type
|
|||||||
FAdditionalAngle: Double;
|
FAdditionalAngle: Double;
|
||||||
FArrow: TChartArrow;
|
FArrow: TChartArrow;
|
||||||
FAttachment: TChartMarkAttachment;
|
FAttachment: TChartMarkAttachment;
|
||||||
|
FAutoMargins: Boolean;
|
||||||
FFrame: _TFramePen;
|
FFrame: _TFramePen;
|
||||||
FYIndex: Integer;
|
FYIndex: Integer;
|
||||||
function GetDistanceToCenter: Boolean;
|
function GetDistanceToCenter: Boolean;
|
||||||
procedure SetArrow(AValue: TChartArrow);
|
procedure SetArrow(AValue: TChartArrow);
|
||||||
procedure SetAttachment(AValue: TChartMarkAttachment);
|
procedure SetAttachment(AValue: TChartMarkAttachment);
|
||||||
|
procedure SetAutoMargins(AValue: Boolean);
|
||||||
procedure SetDistance(AValue: TChartDistance);
|
procedure SetDistance(AValue: TChartDistance);
|
||||||
procedure SetDistanceToCenter(AValue: Boolean);
|
procedure SetDistanceToCenter(AValue: Boolean);
|
||||||
procedure SetFormat(AValue: String);
|
procedure SetFormat(AValue: String);
|
||||||
@ -209,6 +211,8 @@ type
|
|||||||
procedure SetAdditionalAngle(AAngle: Double);
|
procedure SetAdditionalAngle(AAngle: Double);
|
||||||
public
|
public
|
||||||
property Arrow: TChartArrow read FArrow write SetArrow;
|
property Arrow: TChartArrow read FArrow write SetArrow;
|
||||||
|
property AutoMargins: Boolean
|
||||||
|
read FAutoMargins write SetAutoMargins default true;
|
||||||
property DistanceToCenter: Boolean
|
property DistanceToCenter: Boolean
|
||||||
read GetDistanceToCenter write SetDistanceToCenter
|
read GetDistanceToCenter write SetDistanceToCenter
|
||||||
stored false default false;
|
stored false default false;
|
||||||
@ -254,6 +258,7 @@ type
|
|||||||
constructor Create(AOwner: TCustomChart);
|
constructor Create(AOwner: TCustomChart);
|
||||||
published
|
published
|
||||||
property Arrow;
|
property Arrow;
|
||||||
|
property AutoMargins;
|
||||||
property CalloutAngle;
|
property CalloutAngle;
|
||||||
property Distance default DEF_MARKS_DISTANCE;
|
property Distance default DEF_MARKS_DISTANCE;
|
||||||
property Format;
|
property Format;
|
||||||
@ -596,6 +601,7 @@ begin
|
|||||||
if ASource is Self.ClassType then
|
if ASource is Self.ClassType then
|
||||||
with TGenericChartMarks(ASource) do begin
|
with TGenericChartMarks(ASource) do begin
|
||||||
Self.FArrow.Assign(FArrow);
|
Self.FArrow.Assign(FArrow);
|
||||||
|
Self.FAutoMargins := FAutoMargins;
|
||||||
Self.FAttachment := FAttachment;
|
Self.FAttachment := FAttachment;
|
||||||
Self.FDistance := FDistance;
|
Self.FDistance := FDistance;
|
||||||
Self.FFormat := FFormat;
|
Self.FFormat := FFormat;
|
||||||
@ -626,6 +632,7 @@ constructor TGenericChartMarks.Create(AOwner: TCustomChart);
|
|||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
FArrow := TChartArrow.Create(AOwner);
|
FArrow := TChartArrow.Create(AOwner);
|
||||||
|
FAutoMargins := true;
|
||||||
InitHelper(FFrame, _TFramePen);
|
InitHelper(FFrame, _TFramePen);
|
||||||
InitHelper(FLabelBrush, _TLabelBrush);
|
InitHelper(FLabelBrush, _TLabelBrush);
|
||||||
InitHelper(FLabelFont, TFont);
|
InitHelper(FLabelFont, TFont);
|
||||||
@ -706,6 +713,13 @@ begin
|
|||||||
StyleChanged(Self);
|
StyleChanged(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGenericChartMarks.SetAutoMargins(AValue: Boolean);
|
||||||
|
begin
|
||||||
|
if FAutoMargins = AValue then exit;
|
||||||
|
FAutoMargins := AValue;
|
||||||
|
StyleChanged(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TGenericChartMarks.SetDistance(AValue: TChartDistance);
|
procedure TGenericChartMarks.SetDistance(AValue: TChartDistance);
|
||||||
begin
|
begin
|
||||||
if FDistance = AValue then exit;
|
if FDistance = AValue then exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user