We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c36b18 commit 786ea07Copy full SHA for 786ea07
src/components/Chart.tsx
@@ -796,12 +796,14 @@ function sortDatumsBySecondaryPx<TDatum>(
796
const bPx =
797
bAxis?.scale(bAxis.stacked ? b.stackData?.[1] : b.secondaryValue) ?? NaN
798
799
- return aPx > bPx
800
- ? 1
801
- : aPx < bPx
802
- ? -1
803
- : a.seriesIndex > b.seriesIndex
804
805
- : -1
+ if ((aAxis || bAxis)?.stacked) {
+ return a.seriesIndex > b.seriesIndex
+ ? 1
+ : a.seriesIndex < b.seriesIndex
+ ? -1
+ : 0
+ }
806
+
807
+ return aPx > bPx ? 1 : aPx < bPx ? -1 : 0
808
})
809
}
0 commit comments