Home / Function/ ChartTooltipLabelFormatter() — ui Function Reference

ChartTooltipLabelFormatter() — ui Function Reference

Architecture documentation for the ChartTooltipLabelFormatter() function in chart-tooltip-label-formatter.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  8538da66_da1c_ec7d_8899_f8975423bff0["ChartTooltipLabelFormatter()"]
  faaf515a_7b61_78ab_3ac8_224e04ee6427["chart-tooltip-label-formatter.tsx"]
  8538da66_da1c_ec7d_8899_f8975423bff0 -->|defined in| faaf515a_7b61_78ab_3ac8_224e04ee6427
  style 8538da66_da1c_ec7d_8899_f8975423bff0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/registry/new-york-v4/charts/chart-tooltip-label-formatter.tsx lines 41–94

export function ChartTooltipLabelFormatter() {
  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>
  )
}

Subdomains

Frequently Asked Questions

What does ChartTooltipLabelFormatter() do?
ChartTooltipLabelFormatter() is a function in the ui codebase, defined in apps/v4/registry/new-york-v4/charts/chart-tooltip-label-formatter.tsx.
Where is ChartTooltipLabelFormatter() defined?
ChartTooltipLabelFormatter() is defined in apps/v4/registry/new-york-v4/charts/chart-tooltip-label-formatter.tsx at line 41.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free