ChartPNG

Recipes

Charts in a GitHub README

Put a chart in a README that stays sharp on retina screens.

The result

Line chart of builds per week over six weeks
600 CSS pixels wide, drawn at 1200 by 720 pixels. Open the PNG.

Copy a snippet

Markdown

![Builds per week](https://chartpng.dev/chart?w=600&h=360&dpr=2&c=%7B%22type%22%3A%22line%22%2C%22data%22%3A%7B%22labels%22%3A%5B%22W1%22%2C%22W2%22%2C%22W3%22%2C%22W4%22%2C%22W5%22%2C%22W6%22%5D%2C%22datasets%22%3A%5B%7B%22label%22%3A%22Builds%20per%20week%22%2C%22data%22%3A%5B42%2C51%2C47%2C63%2C70%2C82%5D%7D%5D%7D%7D)

HTML, with a display width

<img src="https://chartpng.dev/chart?w=600&h=360&dpr=2&c=%7B%22type%22%3A%22line%22%2C%22data%22%3A%7B%22labels%22%3A%5B%22W1%22%2C%22W2%22%2C%22W3%22%2C%22W4%22%2C%22W5%22%2C%22W6%22%5D%2C%22datasets%22%3A%5B%7B%22label%22%3A%22Builds%20per%20week%22%2C%22data%22%3A%5B42%2C51%2C47%2C63%2C70%2C82%5D%7D%5D%7D%7D" width="600" alt="Builds per week">

Why the HTML version

dpr=2 doubles the pixels but not the layout. The file is 1200 pixels wide and the text stays the size it would have in a 600 pixel chart. The Markdown image syntax has no size, so the picture can show at the full file width. An img tag with width="600" shows it at the size you meant, with twice the pixels behind it.

The Markdown spec GitHub builds on leaves img tags untouched. Its help page on images does not coverwidth, so check the size in the preview tab before you commit.

Caching

Limits that matter

Sources

Claims about other products, read at their source on 2 Nov 2026.