change x axis time format for 1 week chart and add key

This commit is contained in:
Henry Dollman
2024-09-27 13:08:48 -04:00
parent 34c83e7c17
commit 38a9c535b8
2 changed files with 2 additions and 1 deletions

View File

@@ -84,6 +84,7 @@ export default function DiskIoChart({
const color = i ? 'hsl(var(--chart-1))' : 'hsl(var(--chart-3))' const color = i ? 'hsl(var(--chart-1))' : 'hsl(var(--chart-3))'
return ( return (
<Area <Area
key={i}
dataKey={dataKey} dataKey={dataKey}
name={action} name={action}
type="monotoneX" type="monotoneX"

View File

@@ -178,7 +178,7 @@ export const chartTimeData: ChartTimeData = {
expectedInterval: 60_000 * 120, expectedInterval: 60_000 * 120,
label: '1 week', label: '1 week',
ticks: 7, ticks: 7,
format: (timestamp: string) => formatShortDate(timestamp), format: (timestamp: string) => formatDay(timestamp),
getOffset: (endTime: Date) => timeDay.offset(endTime, -7), getOffset: (endTime: Date) => timeDay.offset(endTime, -7),
}, },
'30d': { '30d': {