Chart title and subtitle
A title says what the chart shows, so the image still makes sense when it lands in an email or a chat with nothing around it.
The title is the title plugin, options.plugins.title. It is off until you set display to true and give it a text. The subtitle is a second plugin, options.plugins.subtitle, with the same options. ChartPNG's theme draws the title at the top left in bold, and the subtitle under it in the quieter text colour.
A title
Set display to true and give the text. Without display the title is not drawn.

The part of the config that matters
{
"options": {
"plugins": {
"title": {
"display": true,
"text": "Signups per week"
}
}
}
}The full URL
https://chartpng.dev/chart?w=480&h=280&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 title and a subtitle
The subtitle is its own plugin, under the title, in a quieter colour.

The part of the config that matters
{
"options": {
"plugins": {
"title": {
"display": true,
"text": "Signups per week"
},
"subtitle": {
"display": true,
"text": "Sample data, all channels"
}
}
}
}The full URL
https://chartpng.dev/chart?w=480&h=280&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%2C%22subtitle%22%3A%7B%22display%22%3Atrue%2C%22text%22%3A%22Sample%20data%2C%20all%20channels%22%7D%7D%7D%7DTwo lines
A list of strings is a title on several lines, one string per line.

The part of the config that matters
{
"options": {
"plugins": {
"title": {
"text": ["Signups per week", "first half of the year"]
}
}
}
}The full URL
https://chartpng.dev/chart?w=480&h=280&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%5B%22Signups%20per%20week%22%2C%22first%20half%20of%20the%20year%22%5D%7D%7D%7D%7DPosition, alignment, size and colour
position is top or bottom, align is start, center or end, and font and color style the text.

The part of the config that matters
{
"options": {
"plugins": {
"title": {
"position": "bottom",
"align": "center",
"color": "#b8430f",
"font": {
"size": 22
}
}
}
}
}The full URL
https://chartpng.dev/chart?w=480&h=280&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%2C%22position%22%3A%22bottom%22%2C%22align%22%3A%22center%22%2C%22color%22%3A%22%23b8430f%22%2C%22font%22%3A%7B%22size%22%3A22%7D%7D%7D%7D%7DThings to know
textis a string, or a list of strings for several lines. A function is not accepted: a config is data, and ChartPNG removes callbacks.- The title does not change the size of the image. It takes room from the plot, so a long title on a small chart leaves less chart.
- A title is not a legend. The legend names the datasets and has its own page.
More options
- 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 image size: Width, height and dpr, and the limits on them.
- Chart gallery: every chart type, with its config and URL.
- API reference: every parameter of
/chart, the limits and the errors.