feat(ui): improve chart spacing and labels; format hours <1h as minutes; unify date format to dd/MM (ticks) and dd/MM/yyyy (tooltips); fix tooltips labels ('Total', 'Resolvidos')

This commit is contained in:
codex-bot 2025-10-21 14:52:57 -03:00
parent 4b4c0d8e69
commit f255a4c780
6 changed files with 133 additions and 50 deletions

View file

@ -13,6 +13,7 @@ import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle }
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"
import { ChartContainer, ChartTooltip, ChartTooltipContent } from "@/components/ui/chart"
import { formatDateDM, formatDateDMY } from "@/lib/utils"
import { Skeleton } from "@/components/ui/skeleton"
type SeriesPoint = { date: string; opened: number; resolved: number }
@ -99,10 +100,16 @@ export function ChartOpenedResolved() {
axisLine={false}
tickMargin={8}
minTickGap={32}
tickFormatter={(v) => formatDateDM(new Date(v))}
/>
<ChartTooltip
cursor={false}
content={<ChartTooltipContent indicator="line" />}
content={
<ChartTooltipContent
indicator="line"
labelFormatter={(value) => formatDateDMY(new Date(value as string))}
/>
}
/>
<Line dataKey="opened" type="monotone" stroke="var(--color-opened)" strokeWidth={2} dot={{ r: 2 }} strokeLinecap="round" />
<Line dataKey="resolved" type="monotone" stroke="var(--color-resolved)" strokeWidth={2} dot={{ r: 2 }} strokeLinecap="round" />