fix(style): top users bar name too long

This commit is contained in:
jialin
2025-06-27 16:38:19 +08:00
parent 47a5ef915b
commit abdd5e08a6
3 changed files with 17 additions and 2 deletions
+12 -1
View File
@@ -41,7 +41,18 @@ const BarChart: React.FC<ChartProps> = (props) => {
formatter: labelFormatter formatter: labelFormatter
} }
}, },
yAxis, yAxis: {
...yAxis,
axisLabel: {
...yAxis.axisLabel,
formatter(value: string) {
if (value.length > 10) {
return `${value.slice(0, 10)}...`;
}
return value;
}
}
},
legend: { legend: {
...legend, ...legend,
data: [] data: []
+3
View File
@@ -765,6 +765,9 @@ body {
.tooltip-x-name { .tooltip-x-name {
font-size: var(--font-size-small); font-size: var(--font-size-small);
color: var(--ant-color-text-tertiary); color: var(--ant-color-text-tertiary);
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
} }
.tooltip-item { .tooltip-item {
@@ -33,7 +33,8 @@ const UsageInner: FC<{ maxWidth: number }> = ({ maxWidth }) => {
}); });
const topUserData = useMemo(() => { const topUserData = useMemo(() => {
const topUsers = model_usage?.top_users || []; // top 10 users
const topUsers = model_usage?.top_users?.slice(0, 10) || [];
const topUserPrompt: any = { const topUserPrompt: any = {
name: 'Prompt tokens', name: 'Prompt tokens',