From d26ea280285e02e0ac99a494da42ce90ac4b5c68 Mon Sep 17 00:00:00 2001 From: jialin Date: Fri, 27 Jun 2025 16:27:30 +0800 Subject: [PATCH] fix(style): top users bar name too long --- src/components/echarts/h-bar.tsx | 9 +++------ src/layouts/rightRender.tsx | 8 +++++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/echarts/h-bar.tsx b/src/components/echarts/h-bar.tsx index 3719d1c9..96fd900e 100644 --- a/src/components/echarts/h-bar.tsx +++ b/src/components/echarts/h-bar.tsx @@ -45,12 +45,9 @@ const BarChart: React.FC = (props) => { ...yAxis, axisLabel: { ...yAxis.axisLabel, - formatter(value: string) { - if (value.length > 10) { - return `${value.slice(0, 10)}...`; - } - return value; - } + overflow: 'truncate', + width: 60, + ellipsis: '...' } }, legend: { diff --git a/src/layouts/rightRender.tsx b/src/layouts/rightRender.tsx index 1ab6317d..10589465 100644 --- a/src/layouts/rightRender.tsx +++ b/src/layouts/rightRender.tsx @@ -286,7 +286,13 @@ export const getRightRenderContent = (opts: { {!collapsed && ( {opts.initialState?.currentUser?.username}