TAChart: Undo r60740 #b2a4a7868b (sorting of ListSource by y value). Issue #35188, patch by Marcin Wiazowski.

git-svn-id: trunk@60904 -
This commit is contained in:
wp 2019-04-10 07:51:19 +00:00
parent b3b741485d
commit 48c62ca44d

View File

@ -854,28 +854,9 @@ begin
end;
end;
function CompareDataItemY(AItem1, AItem2: Pointer): Integer;
var
i: Integer;
item1: PChartDataItem absolute AItem1;
item2: PChartDataItem absolute AItem2;
begin
Result := CompareFloat(item1^.Y, item2^.Y);
if Result = 0 then
for i := 0 to Min(High(item1^.YList), High(item2^.YList)) do begin
Result := CompareFloat(item1^.YList[i], item2^.YList[i]);
if Result <> 0 then
exit;
end;
end;
procedure TListChartSource.Sort;
begin
if XCount > 0 then
FData.Sort(@CompareDataItemX)
else
if YCount > 0 then
FData.Sort(@CompareDataItemY);
FData.Sort(@CompareDataItemX);
end;
procedure TListChartSource.UpdateCachesAfterAdd(AX, AY: Double);