time chart int

This commit is contained in:
2025-04-08 07:46:20 +08:00
parent 4e7266240d
commit 6940d60510
8 changed files with 541 additions and 39 deletions

View File

@@ -137,6 +137,11 @@ export default function TimeSeriesChart({ data }: TimeSeriesChartProps) {
return date.toLocaleDateString();
}
return '';
},
label: (context) => {
const label = context.dataset.label || '';
const value = context.parsed.y;
return `${label}: ${Math.round(value)}`;
}
}
}
@@ -160,9 +165,9 @@ export default function TimeSeriesChart({ data }: TimeSeriesChartProps) {
callback: (value: number) => {
if (!value && value !== 0) return '';
if (value >= 1000) {
return `${(value / 1000).toFixed(1)}k`;
return `${Math.round(value / 1000)}k`;
}
return value;
return Math.round(value);
}
}
}