File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -786,6 +786,15 @@ function sortDatumsBySecondaryPx<TDatum>(
786786 datums : Datum < TDatum > [ ] ,
787787 secondaryAxes : Axis < TDatum > [ ]
788788) {
789+ if ( secondaryAxes . every ( d => d . stacked ) ) {
790+ const differingInverts =
791+ secondaryAxes . some ( d => d . invert ) && secondaryAxes . some ( d => ! d . invert )
792+
793+ if ( ! differingInverts ) {
794+ return datums
795+ }
796+ }
797+
789798 return [ ...datums ] . sort ( ( a , b ) => {
790799 const aAxis = secondaryAxes . find ( d => d . id === a . secondaryAxisId )
791800 const bAxis = secondaryAxes . find ( d => d . id === b . secondaryAxisId )
@@ -796,14 +805,6 @@ function sortDatumsBySecondaryPx<TDatum>(
796805 const bPx =
797806 bAxis ?. scale ( bAxis . stacked ? b . stackData ?. [ 1 ] : b . secondaryValue ) ?? NaN
798807
799- if ( ( aAxis || bAxis ) ?. stacked ) {
800- return a . seriesIndex > b . seriesIndex
801- ? 1
802- : a . seriesIndex < b . seriesIndex
803- ? - 1
804- : 0
805- }
806-
807808 return aPx > bPx ? 1 : aPx < bPx ? - 1 : 0
808809 } )
809810}
You can’t perform that action at this time.
0 commit comments