Component() — ui Function Reference
Architecture documentation for the Component() function in chart-tooltip-advanced.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 72b0332e_ca13_3e6d_4547_f954f659438d["Component()"] 4a4d579e_5622_0935_a6b1_8e51bc81b37b["chart-tooltip-advanced.tsx"] 72b0332e_ca13_3e6d_4547_f954f659438d -->|defined in| 4a4d579e_5622_0935_a6b1_8e51bc81b37b style 72b0332e_ca13_3e6d_4547_f954f659438d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
deprecated/www/registry/new-york/charts/chart-tooltip-advanced.tsx lines 41–123
export default function Component() {
return (
<Card>
<CardHeader>
<CardTitle>Tooltip - Advanced</CardTitle>
<CardDescription>
Tooltip with custom formatter and total.
</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
hideLabel
className="w-[180px]"
formatter={(value, name, item, index) => (
<>
<div
className="h-2.5 w-2.5 shrink-0 rounded-[2px] bg-[--color-bg]"
style={
{
"--color-bg": `var(--color-${name})`,
} as React.CSSProperties
}
/>
{chartConfig[name as keyof typeof chartConfig]?.label ||
name}
<div className="ml-auto flex items-baseline gap-0.5 font-mono font-medium tabular-nums text-foreground">
{value}
<span className="font-normal text-muted-foreground">
kcal
</span>
</div>
{/* Add this after the last item */}
{index === 1 && (
<div className="mt-1.5 flex basis-full items-center border-t pt-1.5 text-xs font-medium text-foreground">
Total
<div className="ml-auto flex items-baseline gap-0.5 font-mono font-medium tabular-nums text-foreground">
{item.payload.running + item.payload.swimming}
<span className="font-normal text-muted-foreground">
kcal
</span>
</div>
</div>
)}
</>
)}
/>
}
cursor={false}
defaultIndex={1}
/>
</BarChart>
</ChartContainer>
</CardContent>
</Card>
Domain
Subdomains
Source
Frequently Asked Questions
What does Component() do?
Component() is a function in the ui codebase, defined in deprecated/www/registry/new-york/charts/chart-tooltip-advanced.tsx.
Where is Component() defined?
Component() is defined in deprecated/www/registry/new-york/charts/chart-tooltip-advanced.tsx at line 41.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free