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

fix: allow colors as array #10075

Merged
merged 4 commits into from
Feb 5, 2022
Merged

fix: allow colors as array #10075

merged 4 commits into from
Feb 5, 2022

Conversation

LovelyAndy
Copy link
Contributor

There are some charts where I need to use different label colors per label.
Using a string[] for the label color seems to work, but TS won't allow it.
This PR fixes the types to allow that.

@etimberg
Copy link
Member

Where specifically are you passing the colors as an array? I don't think all spots that accept colours accept arrays of colours, so I'm not sure this change is the correct one to make.

@etimberg etimberg added the type: types Typescript type changes label Jan 15, 2022
@LeeLenaleee
Copy link
Collaborator

LeeLenaleee commented Jan 15, 2022

This will break some parts since in the typing some things are defined as an array of collors like here: https://github.com/chartjs/Chart.js/blob/master/types/index.esm.d.ts#L2822

Which will make a double array valid which isn't supported

@LovelyAndy
Copy link
Contributor Author

@LeeLenaleee Thank you very much. Updated the PR to make the change under TickOptions!

Copy link
Collaborator

@LeeLenaleee LeeLenaleee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

types/index.esm.d.ts Outdated Show resolved Hide resolved
@kurkle kurkle added this to the Version 3.7.1 milestone Jan 16, 2022
Co-authored-by: Jacco van den Berg <[email protected]>
@LovelyAndy
Copy link
Contributor Author

@kurkle Thanks! Updated as per your suggestion.

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

Successfully merging this pull request may close these issues.

5 participants