Skip to content

Commit

Permalink
fix: tooltip secondary axis stable sort
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Jan 26, 2023
1 parent d13a268 commit 3c36b18
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,12 @@ function sortDatumsBySecondaryPx<TDatum>(
const bPx =
bAxis?.scale(bAxis.stacked ? b.stackData?.[1] : b.secondaryValue) ?? NaN

return aPx - bPx
return aPx > bPx
? 1
: aPx < bPx
? -1
: a.seriesIndex > b.seriesIndex
? 1
: -1
})
}

0 comments on commit 3c36b18

Please sign in to comment.