Skip to content
mdxcn is now part of Shadcn Labs. details

plot

GraphPlot

A line or area chart built from columns of block characters. Write a list of numbers, or `- Mon: 4` rows to keep the labels.

use it
Good when the series needs a y-scale.
instead
A handful of points with no axis is Spark.

labeled rows

A list of `label: value` keeps the labels for the axis.

[ SIGNUPS ]
310
MonFri
line plot, 5 points, min 0, max 31
<GraphPlot title="SIGNUPS" variant="line">

- Mon: 12
- Tue: 18
- Wed: 15
- Thu: 24
- Fri: 31

</GraphPlot>

install

command

p95

Last cap is the live point.

[ P95 ]
90
jandec
area plot, 12 points, min 0, max 9
import { GraphPlot } from "@/registry/default/graph-plot/graph-plot"

<GraphPlot title="P95" data="2 3 3 5 4 7 6 8 5 9 7 6" labels={["jan", "dec"]} />

errors

Line only. progress reveals a prefix.

[ ERRORS ]
80
monfri
line plot, 10 points, min 0, max 8
import { GraphPlot } from "@/registry/default/graph-plot/graph-plot"

<GraphPlot
  title="ERRORS"
  variant="line"
  height={5}
  progress={0.7}
  data={[1, 1, 4, 2, 8, 3, 2, 1, 5, 2]}
  labels={["mon", "fri"]}
/>
[ PROPS ]
PropTypeDefaultDescription
titlestring—Caption drawn on the top edge of the frame.
datanumber[] | "2 3 4"—One value per column, left to right. Optional when children are Markdown.
childrenMarkdown—- Mon: 4 Or a line of numbers.
labelsstring[]—First and last labels under the axis.
heightnumber7Rows in the plot.
variant"line" | "area""area"Area fills down from the cap with ░.
progressnumber10–1. How many columns are revealed.
glyphs"shade" | "ascii" | "hash" | "bar" | string[]"shade"Character set. shade is ·░▒▓█. ascii is .- =#@. Pass a preset or your own characters.
palette"mono" | "duo" | "multi""mono"mono is one accent plus muted. duo paints the second series with --graph-accent-2. multi cycles three accents.
cornerstring"+"Character at each corner of the frame.
frame"box" | "corners" | "rule" | "none""box"box draws the dashed border. corners keeps only the corner marks. rule draws dashed lines above and below. none drops the border and padding, and puts the title above the content.
classNamestring—Passed to the outer frame.