Chart image size
The size of the PNG is not in the Chart.js config. It is three parameters of the URL: w, h and dpr.
w and h are the width and the height in pixels, whole numbers from 50 to 2000. Without them the image is 600 by 360. dpr is the pixel ratio, 1 or 2, and is 1 without it. The file has w × dpr by h × dpr pixels. The layout does not change with dpr, only the sharpness.
320 by 200 at dpr 1
w and h are the size in pixels. At dpr 1 the file has exactly that many: 320 by 200.

The size parameters, beside c
w=320&h=200&dpr=1The full URL
https://chartpng.dev/chart?w=320&h=200&dpr=1&c=%7B%22type%22%3A%22bar%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%22Signups%22%2C%22data%22%3A%5B24%2C37%2C31%2C45%2C39%2C52%5D%7D%5D%7D%2C%22options%22%3A%7B%22plugins%22%3A%7B%22title%22%3A%7B%22display%22%3Atrue%2C%22text%22%3A%22Signups%20per%20week%22%7D%7D%7D%7D320 by 200 at dpr 2
dpr 2 draws twice as many pixels each way: a 640 by 400 file for a 320 by 200 slot, sharp on a retina screen. The layout is the same; show the image at 320 by 200.

The size parameters, beside c
w=320&h=200&dpr=2The full URL
https://chartpng.dev/chart?w=320&h=200&dpr=2&c=%7B%22type%22%3A%22bar%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%22Signups%22%2C%22data%22%3A%5B24%2C37%2C31%2C45%2C39%2C52%5D%7D%5D%7D%2C%22options%22%3A%7B%22plugins%22%3A%7B%22title%22%3A%7B%22display%22%3Atrue%2C%22text%22%3A%22Signups%20per%20week%22%7D%7D%7D%7DA wide banner, 900 by 300
Width and height are independent. A wide, short image suits a README banner or a dashboard strip.

The size parameters, beside c
w=900&h=300&dpr=1The full URL
https://chartpng.dev/chart?w=900&h=300&dpr=1&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%22Signups%22%2C%22data%22%3A%5B24%2C37%2C31%2C45%2C39%2C52%5D%7D%5D%7D%2C%22options%22%3A%7B%22plugins%22%3A%7B%22legend%22%3A%7B%22display%22%3Afalse%7D%7D%7D%7DLimits
| What | Limit |
|---|---|
w and h | Whole numbers, 50 to 2000. Outside that: a 400, width and height must be integers between 50 and 2000. |
dpr | 1 or 2. |
| Free plan pixels | 4 megapixels, counted as w × h × dpr². That is 2000 × 2000 at dpr 1, or 1000 × 1000 at dpr 2. 1001 × 1000 at dpr 2 is over. |
| Pro plan pixels | Up to 2000 × 2000 at dpr 2. |
| Config | 16 KB, in a GET and in a POST. A large config goes in a POST. |
| Requests | From one IP address, each minute: 600 GET /chart and 50 POST /chart. |
Things to know
- Text, markers and line widths are drawn at a fixed size in pixels. A small chart has the same text as a big one, so the text fills more of it, and a very small image has little room left for the plot.
- For a retina screen, ask for
dpr=2and show the image atwbyh, as in the second example. - The free plan stamps a small
chartpng.devwatermark in the corner; it is in every image on this page. - The email and Slack output presets pick a size and a pixel ratio for you. The docs list them.
More options
- Chart title and subtitle: A title, a subtitle, where they sit and how big they are.
- Chart legend: Move it to the bottom or the right, hide it, change its markers.
- Chart axes: Minimum and maximum, stacked bars, a horizontal chart, hiding an axis, units.
- Chart colors: Dataset colours, the theme and palette parameters, and the background.
- Chart gallery: every chart type, with its config and URL.
- API reference: every parameter of
/chart, the limits and the errors.