chartjs / chartjs/Chart.js

Cannot add padding when legend is aligned left

Open
#11,280 2 comments 2 reactions 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
67.7k
Forks
11.9k
Avg merge
7h 39m
Merged PRs (30d)
5

Description

### Expected behavior

I want my legend in the top left corner with padding on the left

```
plugins: {
legend: {
display: true,
align: 'start',
title: {
display: true,
padding: {
left: 20
}
}
}
}
```

### Current behavior

`padding: { left: 20 }` has no effect, and `padding: 20` only adds padding to top. Issue seems to have been fixed for some configurations since a [related ticket](https://github.com/chartjs/Chart.js/issues/10388) was closed, but my configuration is not working.

### Reproducible sample

https://codepen.io/elinakeranen/pen/dygewgo

### Optional extra steps/info to reproduce

_No response_

### Possible solution

_No response_

### Context

_No response_

### chart.js version

v.4.3.0

### Browser name and version

_No response_

### Link to your project

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.