Charts

Shadcn-styled graphs for GitHub stars, GitHub issues, npm downloads, and your own JSON data — rendered as portable SVGs.

Shadcn-styled line/area charts you can drop in a README, docs site, or anywhere an image works — plain SVG, no JavaScript, no iframe. Four kinds: GitHub star history (like starcharts), GitHub issues over time, npm downloads, and arbitrary JSON.

![vercel/next.js star history](https://shieldcn.dev/chart/github/stars/vercel/next.js.svg)

Builder

Pick a chart kind, tweak the styling, and copy the URL or markdown.

GET/chart/github/stars/:owner/:repo.svg
![chart](https://shieldcn.dev/chart/github/stars/vercel/next.js.svg)
chart preview

URL format

/chart/github/stars/{owner}/{repo}.svg     → GitHub star history
/chart/github/issues/{owner}/{repo}.svg    → GitHub issues over time
/chart/npm/{package}.svg                    → npm weekly downloads
/chart/json.svg?values=1,2,3                → inline JSON data
/chart/json.svg?url=...&query=...           → remote JSON data

Every endpoint also serves .png and .json (the raw time series).

Use it in markdown:

![Star History](https://shieldcn.dev/chart/github/stars/vercel/next.js.svg)

Or as a clickable image linking back to the repo:

[![Star History](https://shieldcn.dev/chart/github/stars/vercel/next.js.svg)](https://github.com/vercel/next.js)

GitHub stars

Blue accent via theme

![shadcn-ui/ui star history](https://shieldcn.dev/chart/github/stars/shadcn-ui/ui.svg?theme=blue)

Transparent background, no border — drops onto any page

![withastro/astro star history](https://shieldcn.dev/chart/github/stars/withastro/astro.svg?bg=transparent&border=false&theme=orange)

GitHub issues over time

Cumulative issues opened, sampled from the GitHub search API (pull requests excluded).

/chart/github/issues/{owner}/{repo}.svg

Issues opened over time

![honojs/hono issues over time](https://shieldcn.dev/chart/github/issues/honojs/hono.svg?theme=rose)

npm downloads

Weekly download buckets over the last year (configurable with ?days=).

/chart/npm/{package}.svg
/chart/npm/@scope/{package}.svg

Weekly npm downloads

![zod npm downloads](https://shieldcn.dev/chart/npm/zod.svg?theme=emerald)

Your own data (JSON)

Bring numbers inline with ?values= (comma-separated). Add ?dates= for a time axis or ?labels= for category ticks — omit both and points are spaced evenly and labelled 1, 2, 3, ….

/chart/json.svg?values=120,180,150,210,260&title=Latency&label=ms
/chart/json.svg?values=10,20,30&dates=2024-01-01,2024-02-01,2024-03-01

Inline values, evenly spaced index axis

![inline JSON chart](https://shieldcn.dev/chart/json.svg?values=120,180,150,210,260,240,300,280,340&title=Latency&label=ms&theme=violet)

Or pull from a remote endpoint with JSONPath, exactly like the dynamic JSON badge. query selects the value array; optional dateQuery selects a parallel date array.

/chart/json.svg?url=https://api.example.com/metrics.json&query=$.points[*].count&dateQuery=$.points[*].date

Query parameters

ParamValuesDefaultDescription
modedark, lightdarkSurface and text colors
themeblue, green, rose, orange, violet, purple, cyan, emerald, …Accent color from the shadcn palette
colorhex (no #)3b82f6Line + end-dot color (wins over theme)
fillhex (no #)line colorArea fill color, independent of the line
areatrue, falsetrueShow the gradient area fill under the line
bg / backgroundtransparent, hexmode surfaceCard background
bordertrue, falsetrueDraw the rounded card border
fontinter, geist, geist-mono, jetbrains-mono, fira-code, roboto, space-groteskinterFont-family stack (same keywords as badges)
logofalseshownShow/hide the shieldcn corner watermark
logoColorhex (no #)mutedWatermark color
iconSimpleIcons slug, ri:Name, falseauto (github/npm)Icon left of the title
iconColorhex (no #)title colorTitle icon color
yScalelinear, loglinearY-axis scale type
yMinnumber0 (auto)Force the y-axis minimum
yMaxnumberautoForce the y-axis maximum
yTicks1–104Number of y-axis gridline intervals
xTicks2–123Number of x-axis labels
width200–2000800Chart width in px
height120–1200400Chart height in px
titlestringper kindOverride the chart title
days30–540365npm download window
valuescomma numbersInline JSON data points
datescomma datesInline JSON x-axis dates
labelscomma stringsInline JSON x-axis labels
url + queryURL + JSONPathRemote JSON data source

Notefont only swaps the family stack. Charts are raw SVG (needed for the line paths), and a sandboxed <img> SVG can't load embedded fonts — so the rendered typeface depends on what's available to the viewer.

How star history works

GitHub has no "stars over time" API. shieldcn reconstructs the curve from the stargazers endpoint, which (with the star+json media type) returns a starred_at timestamp per stargazer:

  • Small / medium repos — every page is fetched and the full list is sampled down to ~30 points for an exact curve.
  • Large repos — pages are sampled evenly and the first stargazer of each is read, then the curve is anchored to the live star count, exactly like starcharts.

Requests are distributed across the donated token pool and cached with a 6-hour fresh window plus a 30-day last-known-good fallback, so a transient rate limit never collapses the chart.

Data sources

ChartSourceCache
StarsGitHub Stargazers API6h fresh · 30d last-known-good
IssuesGitHub Search API (type:issue)6h fresh · 30d last-known-good
npmnpm downloads API1h
JSONinline, or your url5m (remote)

GitHub requests are distributed across the donated token pool and serve a last-known-good copy if the upstream is briefly unavailable.