Skip to content

Commit 3c36b18

Browse files
committed
fix: tooltip secondary axis stable sort
1 parent d13a268 commit 3c36b18

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/Chart.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,12 @@ function sortDatumsBySecondaryPx<TDatum>(
796796
const bPx =
797797
bAxis?.scale(bAxis.stacked ? b.stackData?.[1] : b.secondaryValue) ?? NaN
798798

799-
return aPx - bPx
799+
return aPx > bPx
800+
? 1
801+
: aPx < bPx
802+
? -1
803+
: a.seriesIndex > b.seriesIndex
804+
? 1
805+
: -1
800806
})
801807
}

0 commit comments

Comments
 (0)