mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 11:19:26 +02:00
TAChart: Achieve consistent behavior for TLineSeries.StackedNaN (issue #35031, note 0114044)
git-svn-id: trunk@60424 -
This commit is contained in:
parent
444d45b352
commit
71a8ee49c6
@ -412,6 +412,27 @@ begin
|
||||
end;
|
||||
|
||||
procedure TLineSeries.Draw(ADrawer: IChartDrawer);
|
||||
|
||||
procedure RemoveStackedNaN;
|
||||
var
|
||||
i, j: Integer;
|
||||
item: PChartDataItem;
|
||||
begin
|
||||
if FStacked and (FStackedNaN = snDoNotDraw) then
|
||||
for i := 0 to High(FGraphPoints) do begin
|
||||
item := Source.Item[i + FLoBound];
|
||||
if not IsNaN(item^.X) then
|
||||
if IsNaN(item^.Y) then
|
||||
FGraphPoints[i].X := NaN
|
||||
else
|
||||
for j := 0 to Source.YCount-2 do
|
||||
if IsNaN(item^.YList[j]) then begin
|
||||
FGraphPoints[i].X := NaN;
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
var
|
||||
ext: TDoubleRect;
|
||||
i: Integer;
|
||||
@ -427,10 +448,12 @@ begin
|
||||
if not RectIntersectsRect(ext, ParentChart.CurrentExtent) then exit;
|
||||
|
||||
PrepareGraphPoints(ext, LineType <> ltFromOrigin);
|
||||
RemoveStackedNaN;
|
||||
DrawSingleLineInStack(ADrawer, 0);
|
||||
for i := 0 to Source.YCount - 2 do begin
|
||||
if Source.IsYErrorIndex(i+1) then Continue;
|
||||
UpdateGraphPoints(i, FStacked);
|
||||
RemoveStackedNaN;
|
||||
DrawSingleLineInStack(ADrawer, i + 1);
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user