noahgdev

Scatter Chart

Dashboards

About

Correlation dots per series that become bubbles when a size key is set, with a per-point tooltip and legend.

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

Code

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

Usage.tsx

"use client"

import { ScatterChart } from "@/components/ui/dashboardcn-scatter-chart"
import { formatNumber } from "@/components/ui/dashboardcn-scatter-chart"

const free = [
  { sessions: 12, revenue: 0 },
  { sessions: 28, revenue: 0 },
  { sessions: 41, revenue: 19 },
  { sessions: 55, revenue: 0 },
  { sessions: 63, revenue: 29 },
  { sessions: 78, revenue: 49 },
  { sessions: 94, revenue: 19 },
  { sessions: 110, revenue: 79 },
]

const pro = [
  { sessions: 68, revenue: 240 },
  { sessions: 95, revenue: 310 },
  { sessions: 132, revenue: 420 },
  { sessions: 148, revenue: 380 },
  { sessions: 176, revenue: 560 },
  { sessions: 203, revenue: 610 },
  { sessions: 231, revenue: 720 },
  { sessions: 258, revenue: 690 },
]

const enterprise = [
  { sessions: 210, revenue: 1_450 },
  { sessions: 265, revenue: 1_820 },
  { sessions: 302, revenue: 1_690 },
  { sessions: 348, revenue: 2_310 },
  { sessions: 390, revenue: 2_640 },
  { sessions: 415, revenue: 2_480 },
]

export default function ScatterChartDemo() {
  return (
    <div className="w-full max-w-lg">
      <ScatterChart
        series={[
          { label: "Free", data: free },
          { label: "Pro", data: pro },
          { label: "Enterprise", data: enterprise },
        ]}
        xKey="sessions"
        yKey="revenue"
        xLabel="Sessions"
        yLabel="Revenue"
        xFormatter={(v) => formatNumber(v)}
        yFormatter={(v) => formatNumber(v, { format: "currency", compact: true })}
        showLegend
      />
    </div>
  )
}

Dependencies

More by noahgdev

View all
  • Donut Chart

    Donut Chart

    1
  • Metric List

    Metric List

  • Sankey Chart

    Sankey Chart

  • Radar Chart

    Radar Chart

  • Composed Chart

    Composed 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