kuratlielia

Line Chart

Dashboards 13

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

    361
  • Image Compare

    Image Compare

    107
  • User Menu

    User Menu

    94
  • Date Range Picker

    Date Range Picker

    63
  • Stats Band

    Stats Band

    53
  • Usage Meter

    Usage Meter

    46
  • Signature Pad

    Signature Pad

    37
  • Timeline

    Timeline

    34

More in Dashboards

View all
  • Dashboard with Collapsible Sidebar

    Dashboard with Collapsible Sidebar

    2.4K
  • Sidebar

    Sidebar

    234
  • SaaS Template

    SaaS Template

    2.4K
  • Chat template

    Chat template

    598
  • Stats Bento

    Stats Bento

    1.1K
  • Financial Bento Grid

    Financial Bento Grid

    71
  • Statistics Card 2

    Statistics Card 2

    264
  • Course Design Cards

    Course Design Cards

    1.1K