format x-axis

This commit is contained in:
Alex Holliday committed 2025-12-18 12:57:05 -08:00
1 parent 6f41167456
commit 88dc2f4096
2 files changed
+8 -2

No files matched your search

@@ -1,5 +1,6 @@
import { BaseChart } from "@/components/monitors/Chart"; import { BaseChart } from "@/components/monitors/Chart";
import { TrendingUp } from "lucide-react"; import { TrendingUp } from "lucide-react";
import { XTick } from "./ChartResponseTime";
import { import {
XAxis, XAxis,
AreaChart, AreaChart,
@@ -49,8 +50,10 @@ const config: Record<string, ConfigItem> = {
export const HistogramPageSpeedScores = ({ export const HistogramPageSpeedScores = ({
checks, checks,
range,
}: { }: {
checks: GroupedCheck[]; checks: GroupedCheck[];
range: string;
}) => { }) => {
const theme = useTheme(); const theme = useTheme();
return ( return (
@@ -60,7 +63,10 @@ export const HistogramPageSpeedScores = ({
> >
<ResponsiveContainer width="100%" minWidth={25} height={215}> <ResponsiveContainer width="100%" minWidth={25} height={215}>
<AreaChart data={checks}> <AreaChart data={checks}>
<XAxis dataKey={"_id"} /> <XAxis
dataKey={"_id"}
tick={(props) => <XTick {...props} range={range} />}
/>
<CartesianGrid <CartesianGrid
stroke={theme.palette.divider} stroke={theme.palette.divider}
strokeWidth={1} strokeWidth={1}
@@ -87,7 +87,7 @@ const PageSpeedDetailsPage = () => {
/> />
</Stack> </Stack>
<HeaderRange loading={isValidating} range={range} setRange={setRange} /> <HeaderRange loading={isValidating} range={range} setRange={setRange} />
<HistogramPageSpeedScores checks={checks} /> <HistogramPageSpeedScores checks={checks} range={range} />
<Stack direction={isSmall ? "column" : "row"} gap={theme.spacing(10)}> <Stack direction={isSmall ? "column" : "row"} gap={theme.spacing(10)}>
<ChartPageSpeedReport latestCheck={checks?.[0]} /> <ChartPageSpeedReport latestCheck={checks?.[0]} />
<ChartPageSpeedReportLegend latestCheck={checks?.[0]} /> <ChartPageSpeedReportLegend latestCheck={checks?.[0]} />