Mark Yo

Line Chart

Dashboards

About

An animated SVG line/area chart that draws its lines left to right on scroll, with a snapping crosshair cursor and one tooltip listing every series' value.

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/chart-line";

const data = [
  { month: "Jan", revenue: 4200, expenses: 2800 },
  { month: "Feb", revenue: 5100, expenses: 3100 },
  { month: "Mar", revenue: 4800, expenses: 3400 },
  { month: "Apr", revenue: 6200, expenses: 3600 },
  { month: "May", revenue: 7100, expenses: 3900 },
  { month: "Jun", revenue: 6800, expenses: 4100 },
  { month: "Jul", revenue: 7600, expenses: 4300 },
  { month: "Aug", revenue: 8200, expenses: 4500 },
];

export default function LineChartDemo() {
  return (
    <div className="flex w-full max-w-xl items-center justify-center p-6">
      <LineChart
        title="Revenue"
        data={data}
        index="month"
        series={[
          { key: "revenue", label: "Revenue" },
          { key: "expenses", label: "Expenses" },
        ]}
        dots
      />
    </div>
  );
}

More by Mark Yo

View all
  • Loader

    Loader

    67
  • Pricing Table

    Pricing Table

    24
  • Bento Grid

    Bento Grid

    10
  • Wallet Card

    Wallet Card

    4
  • Expandable Tabs

    Expandable Tabs

    4
  • Image Gallery

    Image Gallery

    3
  • CTA Section

    CTA Section

    3
  • Bar Chart

    Bar Chart

    1

More in Dashboards

View all
  • Creator Dashboard

    Creator Dashboard

    94
  • serf dashboard

    serf dashboard

    84
  • Dashboard with Collapsible Sidebar

    Dashboard with Collapsible Sidebar

    2.6K
  • Glass Dashboard

    Glass Dashboard

    1.1K
  • Adjustable Glass Dashboard

    Adjustable Glass Dashboard

    1.2K
  • App Dashboard Layout

    App Dashboard Layout

    572
  • Sidebar

    Sidebar

    422
  • Dashboard Shell

    Dashboard Shell

    215