From 1024c597cf7652659fc16ccb6b82b2509bada1c1 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Sat, 12 Oct 2024 22:45:36 +0800 Subject: [PATCH] fix: tooltip order --- components/ui/chart.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/ui/chart.tsx b/components/ui/chart.tsx index 0cc3d7f9f..34560f474 100644 --- a/components/ui/chart.tsx +++ b/components/ui/chart.tsx @@ -172,6 +172,10 @@ const ChartTooltipContent = React.forwardRef< return null; } + payload.sort((a, b) => { + return Number(b.value) - Number(a.value); + }); + const nestLabel = payload.length === 1 && indicator !== "dot"; return (