chartjs / chartjs/Chart.js

Title padding does not appear to be scriptable (or type needs updating?)

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

Description

### Documentation Is:

- [ ] Missing or needed?
- [ ] Confusing
- [x] Not sure?

### Please Explain in Detail...

The configuration section (https://www.chartjs.org/docs/latest/configuration/title.html#title-configuration) indicates that the `padding` property is scriptable, but the allowed types include only `number | { top: number; bottom: number }` and not `Scriptable` or `ScriptableOptions`, etc: https://github.com/chartjs/Chart.js/blob/ec927ee0854b7369b892afbdb14d5a12196887de/src/types/index.d.ts#L2543

### Your Proposal for Changes

It appears that either:
- The documentation needs to be updated to show that `padding` on the `Title` element is not scriptable
- Or if it is scriptable, the types may need to be edited to include functions that return `number | { top: number; bottom: number }`

### Example

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Compare the title configuration documentation at the linked padding section with the declaration in src/types/index.d.ts around line 2543. Determine whether Title padding is scriptable, then align the documentation or type definition so they agree. Done means the documented behavior and allowed type are consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation, frontend
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.