chart-tooltip-label-formatter.tsx — ui Source File
Architecture documentation for chart-tooltip-label-formatter.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR e0d2c835_23bd_641b_1c8d_e5cdb42c4c90["chart-tooltip-label-formatter.tsx"] da384753_eb23_55ed_e7a6_3bd0e172b999["recharts"] e0d2c835_23bd_641b_1c8d_e5cdb42c4c90 --> da384753_eb23_55ed_e7a6_3bd0e172b999 95a7752f_4b97_5bde_5d7d_fca03536ac35["card"] e0d2c835_23bd_641b_1c8d_e5cdb42c4c90 --> 95a7752f_4b97_5bde_5d7d_fca03536ac35 54edb93d_8b2b_eda5_dfc1_461038aaa132["chart"] e0d2c835_23bd_641b_1c8d_e5cdb42c4c90 --> 54edb93d_8b2b_eda5_dfc1_461038aaa132 style e0d2c835_23bd_641b_1c8d_e5cdb42c4c90 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import { Bar, BarChart, XAxis } from "recharts"
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/registry/new-york/ui/card"
import {
ChartConfig,
ChartContainer,
ChartTooltip,
ChartTooltipContent,
} from "@/registry/new-york/ui/chart"
export const description = "A stacked bar chart with a legend"
const chartData = [
{ date: "2024-07-15", running: 450, swimming: 300 },
{ date: "2024-07-16", running: 380, swimming: 420 },
{ date: "2024-07-17", running: 520, swimming: 120 },
{ date: "2024-07-18", running: 140, swimming: 550 },
{ date: "2024-07-19", running: 600, swimming: 350 },
{ date: "2024-07-20", running: 480, swimming: 400 },
]
const chartConfig = {
running: {
label: "Running",
color: "hsl(var(--chart-1))",
},
swimming: {
label: "Swimming",
color: "hsl(var(--chart-2))",
},
} satisfies ChartConfig
export default function Component() {
return (
<Card>
<CardHeader>
<CardTitle>Tooltip - Label Formatter</CardTitle>
<CardDescription>Tooltip with label formatter.</CardDescription>
</CardHeader>
<CardContent>
<ChartContainer config={chartConfig}>
<BarChart accessibilityLayer data={chartData}>
<XAxis
dataKey="date"
tickLine={false}
tickMargin={10}
axisLine={false}
tickFormatter={(value) => {
return new Date(value).toLocaleDateString("en-US", {
weekday: "short",
})
}}
/>
<Bar
dataKey="running"
stackId="a"
fill="var(--color-running)"
radius={[0, 0, 4, 4]}
/>
<Bar
dataKey="swimming"
stackId="a"
fill="var(--color-swimming)"
radius={[4, 4, 0, 0]}
/>
<ChartTooltip
content={
<ChartTooltipContent
labelFormatter={(value) => {
return new Date(value).toLocaleDateString("en-US", {
day: "numeric",
month: "long",
year: "numeric",
})
}}
/>
}
cursor={false}
defaultIndex={1}
/>
</BarChart>
</ChartContainer>
</CardContent>
</Card>
)
}
Domain
Subdomains
Functions
Dependencies
- card
- chart
- recharts
Source
Frequently Asked Questions
What does chart-tooltip-label-formatter.tsx do?
chart-tooltip-label-formatter.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in chart-tooltip-label-formatter.tsx?
chart-tooltip-label-formatter.tsx defines 1 function(s): Component.
What does chart-tooltip-label-formatter.tsx depend on?
chart-tooltip-label-formatter.tsx imports 3 module(s): card, chart, recharts.
Where is chart-tooltip-label-formatter.tsx in the architecture?
chart-tooltip-label-formatter.tsx is located at deprecated/www/registry/new-york/charts/chart-tooltip-label-formatter.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: deprecated/www/registry/new-york/charts).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free