chartjs / chartjs/Chart.js

ticks padding does not work as expected

Open
#11,739 2 comments 5 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

the doc for options.scales[scaleId].ticks.padding says : "number 3 Sets the offset of the tick labels from the axis"

### Current behavior

but instead the padding is applied all around the label making the graph area unnecessary smaller

and we can't use the padding object here

plus it is not "from the axis" but from the "tick drawing" (unclear)

### Reproducible sample

https://codepen.io/roger21-the-bold/pen/JjVBWyp

### Optional extra steps/info to reproduce

_No response_

### Possible solution

_No response_

### Context

_No response_

### chart.js version

4.4.2

### Browser name and version

firefox 115.9.1esr

### 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.