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
Line chart — dots colors variant.
View the full component source code below.
"use client"
import { CartesianGrid, Line, LineChart, 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", harare: 186, nairobi: 130 },
{ month: "Feb", harare: 305, nairobi: 240 },
{ month: "Mar", harare: 237, nairobi: 180 },
{ month: "Apr", harare: 173, nairobi: 220 },
{ month: "May", harare: 409, nairobi: 310 },
{ month: "Jun", harare: 214, nairobi: 170 },
]
const config = {
harare: { label: "Harare", color: "var(--color-cobalt, #00B0FF)" },
nairobi: { label: "Nairobi", color: "var(--color-malachite, #64FFDA)" },
} satisfies ChartConfig
export function ChartLineDotsColors({ loading = false }: { loading?: boolean } = {}) {
return (
<Card role="figure" data-slot="chart-block" data-portal="https://design.nyuchi.com/components/chart-block" aria-label="Line chart">
<CardHeader>
<CardTitle>Line Chart - Colored Dots</CardTitle>
<CardDescription>Each series with distinct dot colors</CardDescription>
</CardHeader>
<CardContent>
<ChartContainer config={config} loading={loading}>
<LineChart data={DEFAULT_DATA} margin={{ left: 12, right: 12 }}>
<CartesianGrid vertical={false} />
<XAxis dataKey="month" tickLine={false} axisLine={false} tickMargin={8} />
<ChartTooltip content={<ChartTooltipContent />} />
<Line
type="natural"
dataKey="harare"
stroke="var(--color-harare)"
strokeWidth={2}
dot={{ r: 4, fill: "var(--color-harare)" }}
/>
<Line
type="natural"
dataKey="nairobi"
stroke="var(--color-nairobi)"
strokeWidth={2}
dot={{ r: 4, fill: "var(--color-nairobi)" }}
/>
</LineChart>
</ChartContainer>
</CardContent>
</Card>
)
}
npx shadcn@latest add https://mzizi.dev/api/v1/ui/chart-line-dots-colorsFetch this component's metadata and source code from the registry API.
/api/v1/ui/chart-line-dots-colorscomponents/blocks/charts/chart-line-dots-colors.tsx