Max value chart

This commit is contained in:
2025-12-28 02:51:12 +01:00
parent 6f5906cf9b
commit cf30e20e42
2 changed files with 7 additions and 1 deletions
+4 -1
View File
@@ -7,7 +7,7 @@ import {
CardTitle,
CardDescription,
} from "@/components/ui/card";
import { AreaChart, Area, XAxis, CartesianGrid } from "recharts";
import { AreaChart, Area, XAxis, CartesianGrid, YAxis } from "recharts";
import {
ChartContainer,
ChartTooltip,
@@ -19,10 +19,12 @@ export default function GradientAreaChart({
title,
data,
config,
max,
}: {
title: string;
data: any[];
config: ChartConfig;
max?: number;
}) {
return (
<Card>
@@ -40,6 +42,7 @@ export default function GradientAreaChart({
tickLine={false}
tickMargin={8}
/>
{max && <YAxis domain={[0, max]} width={10} />}
<ChartTooltip cursor={false} content={<ChartTooltipContent />} />
<defs>
{Object.entries(config).map(([key, config]) => (