Menu

Custom Charts Collection: Bar, Line, & Pie

Start telling stories with your data. We’ve expanded our chart collection to include Line Charts and Pie Charts, along with our beloved Bar Charts.

All charts support our signature hand-drawn aesthetic, CSS-only animations, and scroll triggers.

The Components

We’ve organized these components into a dedicated charts folder:

src/components/charts/

  • <BarChart />
  • <LineChart />
  • <PieChart />

You can use them directly in your MDX files.


1. Bar Charts

Perfect for comparing categories.

Clean Style

10 A 25 B 15 C

Hand-Drawn Style

80 Sketch 60 Draw

Scribble Style

45 Rough 90 Draft

2. Line Charts [NEW]

Great for showing trends over time.

Basic Line

Jan 10 Feb 25 Mar 45 Apr 30 May 60

Sketchy Line with Area

Mon 20 Tue 40 Wed 35 Thu 80 Fri 55

3. Pie Charts [NEW]

Visualizing proportions has never been this fun.

Hand-Drawn Pie

40.0% 30.0% 30.0%
Work
Sleep
Play

Scribble & Animation

60.0% 25.0% 15.0%
Code
Coffee
Bugs

4. Scroll-Triggered Animations

All charts support trigger="visible". The animation will only start when the chart enters the viewport.

↓ Scroll down to trigger the chart below ↓

Start 0 Middle 50 End 100

Implementation Guide

To use these yourself:

  1. Placement: Keep your components organized in src/components/charts/.
  2. Import: Import them into your Astro pages or layout.
  3. Usage: Pass data as an array of { label, value }.
  4. Styling: Use the style prop to switch between “clean”, “hand-drawn”, “scribble”, etc.
<PieChart 
  data={[{ label: 'A', value: 10 }, { label: 'B', value: 20 }]} 
  style="hand-drawn" 
/>

Now go forth and visualize!