nyuchimzizi
Mzizi — an open-architecture project of the Bundu Foundation, operated and developed by Nyuchi. Built on the Five African Minerals palette.
Built by Nyuchi Africav4.0.39
Area chart — gradient variant.
View the full component source code below.
"use client"
import { Area, AreaChart, CartesianGrid, XAxis } from "recharts"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import {
ChartConfig,
ChartContainer,
ChartTooltip,
ChartTooltipContent,
} from "@/components/ui/chart"
const DEFAULT_DATA = [
{ month: "Jan", temperature: 28 },
{ month: "Feb", temperature: 30 },
{ month: "Mar", temperature: 27 },
{ month: "Apr", temperature: 24 },
{ month: "May", temperature: 20 },
{ month: "Jun", temperature: 18 },
]
const config = {
temperature: { label: "Temperature", color: "var(--color-cobalt, #00B0FF)" },
} satisfies ChartConfig
export function ChartAreaGradient({ loading = false }: { loading?: boolean } = {}) {
return (
<Card role="figure" data-slot="chart-block" data-portal="https://design.nyuchi.com/components/chart-block" aria-label="Area chart">
<CardHeader>
<CardTitle>Area Chart - Gradient</CardTitle>
<CardDescription>Area with gradient fill</CardDescription>
</CardHeader>
<CardContent>
<ChartContainer config={config} loading={loading}>
<AreaChart data={DEFAULT_DATA} margin={{ left: 12, right: 12 }}>
<CartesianGrid vertical={false} />
<XAxis dataKey="month" tickLine={false} axisLine={false} tickMargin={8} />
<ChartTooltip content={<ChartTooltipContent />} />
<defs>
<linearGradient id="fillTemp" x1="0" y1="0" x2="0" y2="1">
<stop offset="5%" stopColor="var(--color-temperature)" stopOpacity={0.8} />
<stop offset="95%" stopColor="var(--color-temperature)" stopOpacity={0.1} />
</linearGradient>
</defs>
<Area
type="natural"
dataKey="temperature"
fill="url(#fillTemp)"
stroke="var(--color-temperature)"
/>
</AreaChart>
</ChartContainer>
</CardContent>
</Card>
)
}
npx shadcn@latest add https://mzizi.dev/api/v1/ui/chart-area-gradientFetch this component's metadata and source code from the registry API.
/api/v1/ui/chart-area-gradientcomponents/blocks/charts/chart-area-gradient.tsx