noahgdev

Heatmap Chart

Dashboards

About

A matrix heatmap with a row per line and a column per label, e.g. weekday by hour, with hover highlighting and tooltips.

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

Code

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

Usage.tsx

import { HeatmapChart } from "@/components/ui/dashboardcn-heatmap-chart"

const days = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
const hours = Array.from({ length: 12 }, (_, i) => String(i * 2).padStart(2, "0"))

// Deterministic sample data so the demo is stable between renders: a working-hours
// peak on weekdays, a quieter and later curve at the weekend, plus some noise.
function sampleRows() {
  let seed = 7
  const random = () => {
    seed = (seed * 1664525 + 1013904223) % 4294967296
    return seed / 4294967296
  }
  return days.map((label, d) => {
    const weekend = d >= 5
    return {
      label,
      values: hours.map((_, h) => {
        const hour = h * 2 + 1
        const peak = weekend ? 15 : 14
        const shape = Math.exp(-((hour - peak) ** 2) / (weekend ? 40 : 22))
        const base = (weekend ? 90 : 320) * shape + (weekend ? 6 : 12)
        return Math.round(base * (0.75 + random() * 0.5))
      }),
    }
  })
}

const rows = sampleRows()

export default function HeatmapChartDemo() {
  return (
    <div className="w-full max-w-lg">
      <HeatmapChart rows={rows} columns={hours} unit="sessions" />
    </div>
  )
}

More by noahgdev

View all
  • Metric List

    Metric List

  • Sankey Chart

    Sankey Chart

  • Scatter Chart

    Scatter Chart

  • Radar Chart

    Radar Chart

  • Donut Chart

    Donut Chart

  • Composed Chart

    Composed Chart

  • Bar Chart

    Bar Chart

  • Funnel Chart

    Funnel Chart

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