mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-07 20:56:31 +02:00
TAChart: Improved determination of series marks direction. Issue #35025. Modified patch by Marcin Wiazowski.
git-svn-id: branches/fixes_2_0@60387 -
This commit is contained in:
parent
7b22ce1935
commit
621e9c876f
@ -1417,6 +1417,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TBasicPointSeries.GetLabelDirection(AIndex: Integer): TLabelDirection;
|
function TBasicPointSeries.GetLabelDirection(AIndex: Integer): TLabelDirection;
|
||||||
|
|
||||||
|
function CenterLevel: Double;
|
||||||
|
begin
|
||||||
|
with Extent do
|
||||||
|
if IsRotated then
|
||||||
|
Result := (b.x + a.x) * 0.5
|
||||||
|
else
|
||||||
|
Result := (b.y + a.y) * 0.5;
|
||||||
|
end;
|
||||||
|
|
||||||
const
|
const
|
||||||
DIR: array [Boolean, Boolean] of TLabelDirection =
|
DIR: array [Boolean, Boolean] of TLabelDirection =
|
||||||
((ldTop, ldBottom), (ldRight, ldLeft));
|
((ldTop, ldBottom), (ldRight, ldLeft));
|
||||||
@ -1424,19 +1434,26 @@ var
|
|||||||
isNeg: Boolean;
|
isNeg: Boolean;
|
||||||
ref: Double;
|
ref: Double;
|
||||||
begin
|
begin
|
||||||
if FSupportsZeroLevel then
|
|
||||||
ref := GetZeroLevel
|
|
||||||
else
|
|
||||||
with Extent do
|
|
||||||
if IsRotated then
|
|
||||||
ref := (b.x + a.x) / 2
|
|
||||||
else
|
|
||||||
ref := (b.y + a.y) / 2;
|
|
||||||
case MarkPositions of
|
case MarkPositions of
|
||||||
lmpOutside: isNeg := Source[AIndex]^.Y < ref;
|
|
||||||
lmpPositive: isNeg := false;
|
lmpPositive: isNeg := false;
|
||||||
lmpNegative: isNeg := true;
|
lmpNegative: isNeg := true;
|
||||||
lmpInside: isNeg := Source[AIndex]^.Y >= ref;
|
lmpOutside,
|
||||||
|
lmpInside :
|
||||||
|
begin
|
||||||
|
ref := IfThen(FSupportsZeroLevel, GetZeroLevel, CenterLevel);
|
||||||
|
if Source[AIndex]^.Y < ref then
|
||||||
|
isNeg := true
|
||||||
|
else
|
||||||
|
if Source[AIndex]^.Y > ref then
|
||||||
|
isNeg := false
|
||||||
|
else
|
||||||
|
if not FSupportsZeroLevel then
|
||||||
|
isNeg := false
|
||||||
|
else
|
||||||
|
isNeg := Source[AIndex]^.Y < CenterLevel;
|
||||||
|
if MarkPositions = lmpInside then
|
||||||
|
isNeg := not isNeg;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
if Assigned(GetAxisY) then
|
if Assigned(GetAxisY) then
|
||||||
if (IsRotated and ParentChart.IsRightToLeft) xor GetAxisY.Inverted then
|
if (IsRotated and ParentChart.IsRightToLeft) xor GetAxisY.Inverted then
|
||||||
|
Loading…
Reference in New Issue
Block a user