kuratlielia

Line Chart

Dashboards 22

About

A multi-series line chart with a scrubbable crosshair, legend toggles to show/hide series, and lines that smoothly morph when the data range changes.

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

Code

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

Usage.tsx

"use client";

import LineChart from "@/components/ui/line-chart";

const data = [
  {
    key: "mon",
    label: "Monday",
    axisLabel: "Mon",
    values: { visits: 420, signups: 32 },
  },
  {
    key: "tue",
    label: "Tuesday",
    axisLabel: "Tue",
    values: { visits: 532, signups: 41 },
  },
  {
    key: "wed",
    label: "Wednesday",
    axisLabel: "Wed",
    values: { visits: 489, signups: 38 },
  },
  {
    key: "thu",
    label: "Thursday",
    axisLabel: "Thu",
    values: { visits: 612, signups: 55 },
  },
  {
    key: "fri",
    label: "Friday",
    axisLabel: "Fri",
    values: { visits: 701, signups: 63 },
  },
  {
    key: "sat",
    label: "Saturday",
    axisLabel: "Sat",
    values: { visits: 548, signups: 44 },
  },
  {
    key: "sun",
    label: "Sunday",
    axisLabel: "Sun",
    values: { visits: 597, signups: 50 },
  },
];

const series = [
  { key: "visits", label: "Visits" },
  { key: "signups", label: "Signups", dashed: true },
];

export default function LineChartDemo() {
  return (
    <div className="w-full max-w-xl p-6">
      <LineChart
        data={data}
        series={series}
        label="Weekly visits and signups"
      />
    </div>
  );
}

Dependencies

More by kuratlielia

View all
  • Activity Heatmap

    Activity Heatmap

    524
  • Image Compare

    Image Compare

    227
  • Stats Band

    Stats Band

    166
  • User Menu

    User Menu

    119
  • Date Range Picker

    Date Range Picker

    111
  • Usage Meter

    Usage Meter

    83
  • Ridgeline Chart

    Ridgeline Chart

    70
  • Timeline

    Timeline

    62

More in Dashboards

View all
  • Fernly — Project Management Dashboard with Kanban

    Fernly — Project Management Dashboard with Kanban

    751
  • Analytics Dashboard

    Analytics Dashboard

    81
  • Creator Dashboard

    Creator Dashboard

    216
  • Insights Dashboard

    Insights Dashboard

    44
  • Corbel — Sales Analytics Dashboard

    Corbel — Sales Analytics Dashboard

    446
  • serf dashboard

    serf dashboard

    144
  • Dashboard with Collapsible Sidebar

    Dashboard with Collapsible Sidebar

    2.7K
  • Halden — CRM Dashboard with Sales Pipeline

    Halden — CRM Dashboard with Sales Pipeline

    65