noahgdev

Composed Chart

Dashboards

About

A composed chart for shadcn/ui that mixes areas, lines, and bars in one plot, with a second y-axis for series on different scales, reference lines, peak markers, and hatched bars for forecast or projected values.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Composed Chart to your project and fits it to your theme.

Code

How Composed Chart is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client"

import { ComposedChart } from "@/components/ui/dashboardcn-composed-chart"
import { formatNumber } from "@/components/ui/dashboardcn-composed-chart"

const data = [
  { month: "Jan", sales: 42_000, goal: 40_000 },
  { month: "Feb", sales: 38_500, goal: 41_000 },
  { month: "Mar", sales: 47_200, goal: 42_000 },
  { month: "Apr", sales: 51_800, goal: 43_000 },
  { month: "May", sales: 49_100, goal: 44_000 },
  { month: "Jun", sales: 56_400, goal: 45_000 },
  { month: "Jul", sales: 61_900, goal: 46_000 },
  { month: "Aug", sales: 58_300, goal: 47_000 },
]

export default function ComposedChartDemo() {
  return (
    <ComposedChart
      data={data}
      xKey="month"
      series={[
        { key: "sales", label: "Sales", type: "area", highlightMax: true },
        { key: "goal", label: "Goal", type: "line", dashed: true, color: "var(--muted-foreground)" },
      ]}
      referenceLines={[{ y: 50_000, label: "Target" }]}
      yFormatter={(v) => formatNumber(v, { format: "compact" })}
      showYAxis
      showLegend
    />
  )
}

Dependencies

More by noahgdev

View all
  • Donut Chart

    Donut Chart

    1
  • Metric List

    Metric List

  • Sankey Chart

    Sankey Chart

  • Scatter Chart

    Scatter Chart

  • Radar Chart

    Radar Chart

  • Bar Chart

    Bar Chart

  • Funnel Chart

    Funnel Chart

  • Activity Heatmap

    Activity Heatmap

More in Dashboards

View all
  • Fernly — Project Management Dashboard with Kanban

    Fernly — Project Management Dashboard with Kanban

    659
  • Analytics Dashboard

    Analytics Dashboard

    59
  • Creator Dashboard

    Creator Dashboard

    208
  • Insights Dashboard

    Insights Dashboard

    35
  • serf dashboard

    serf dashboard

    137
  • Corbel — Sales Analytics Dashboard

    Corbel — Sales Analytics Dashboard

    293
  • Dashboard with Collapsible Sidebar

    Dashboard with Collapsible Sidebar

    2.7K
  • Business/Sales Dashboard

    Business/Sales Dashboard

    1.5K