Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error with font weight as a number #11603

Closed
thomas-haufe opened this issue Nov 30, 2023 · 0 comments · Fixed by #11605
Closed

Type error with font weight as a number #11603

thomas-haufe opened this issue Nov 30, 2023 · 0 comments · Fixed by #11605
Labels
type: bug type: types Typescript type changes

Comments

@thomas-haufe
Copy link

Expected behavior

No TypeScript error

Current behavior

Following error:
Type 'number' is not assignable to type 'string | ((ctx: ScriptableCartesianScaleContext, options: AnyObject) => string | null | undefined) | null | undefined'.

Reproducible sample

https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgYQBYENYBoUdgeTBmAgDsBnOAXzgDMoIQ4ByAYzxgDoArc5gbgCwAKBGsy5eBCIkKALlyYYhYhIA8zAEYBXTZoA2AU2YA+OAF5EIuHHKt0R8goTWbcAB7PXbuMRhGvYR8fGEN3GAVmdwBBd2A+LG9g2jIIqyDgnwB3Q2AAc1Q0gE4ABhLEjMyqJJtqyupXOqohUWEAN0w4Vhh3CzgAEwhWbRBDUi48wxgAUSNR8YAhAE8ASX6ACgAiECW0JU2ASjh0SgAJABUAWQAZZHRSDvJZw3mYFo6oOB292D7SQyyilg6267hwLnqMCWYEMkR0eiMzAqPn66Bg6ECmVR6PIUyccAA2jU3BDMj59OhNIZ9JFsScpkjiSi0RjCQhPHAAIw4JYKABMOCgCgAzFRwRyBXBeXBhYKRVQALrIsli4lKpKq+rSVTyODa2TkZWag78IA

Optional extra steps/info to reproduce

No response

Possible solution

Update the type of 'weight' in the 'FontSpec' interface to also accept numbers.

Context

No response

chart.js version

v4.4.0

Browser name and version

No response

Link to your project

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug type: types Typescript type changes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants