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

Different font colors for different point labels? #5074

Closed
flaurida opened this issue Dec 22, 2017 · 5 comments
Closed

Different font colors for different point labels? #5074

flaurida opened this issue Dec 22, 2017 · 5 comments

Comments

@flaurida
Copy link
Contributor

Hi again Chart.js,

Related to my earlier question about connecting a radar chart points with missing data, is it possible to give those point labels a different font color where the data is missing? For example, I would like to make the labels for points with no data gray. Happy holidays!

Sincerely,
Laura

@etimberg
Copy link
Member

This isn't currently possible. It would require modifying the scale to support an array (or function) for the point label font options and the modifying the fit and render code in https://github.com/chartjs/Chart.js/blob/master/src/scales/scale.radialLinear.js to support these arrays.

@WillP111
Copy link

WillP111 commented Jan 5, 2018

Hi,
I have a similar issue with radar plots and want to colour specific axes differently to indicate when there is no data available for an axes (in some plots we don't include point labels, hence the need for axes colouration). I assume the response for this is the same as for Laura's on point labels, we would have to alter scale.radialLinear.js to allow an array of rgba colours for the angleLines?

Thanks
Will

@dariobraun
Copy link

Is this feature still needed? I'd like to give it a shot if someone could point me in the right direction!

@thecatontheflat
Copy link

According to the source code, it works if you pass the array of colors to the fontColor, e.g.

fontColor: ['#f84982', '#f84982', '#86909a', '#86909a', '#86909a']

@etimberg
Copy link
Member

etimberg commented Jan 2, 2020

An array of colours is supported and is the best way to achieve this. We may look at allowing functions to be passed for these parameters in the future.

@etimberg etimberg closed this as completed Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants