Option reference

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.

The numbers in the images are sample data. Each image is what the URL under it returns.

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.

Small bar chart of signups per week, 320 by 200 pixels

The size parameters, beside c

w=320&h=200&dpr=1

The 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%7D

320 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 same small bar chart of signups per week, drawn at twice the pixel density

The size parameters, beside c

w=320&h=200&dpr=2

The 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%7D

A wide banner, 900 by 300

Width and height are independent. A wide, short image suits a README banner or a dashboard strip.

Wide line chart of signups per week, 900 by 300 pixels

The size parameters, beside c

w=900&h=300&dpr=1

The 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%7D

Limits

WhatLimit
w and hWhole numbers, 50 to 2000. Outside that: a 400, width and height must be integers between 50 and 2000.
dpr1 or 2.
Free plan pixels4 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 pixelsUp to 2000 × 2000 at dpr 2.
Config16 KB, in a GET and in a POST. A large config goes in a POST.
RequestsFrom one IP address, each minute: 600 GET /chart and 50 POST /chart.

Things to know

More options