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

Font color for numberDisplay chart #913

Closed
TeodorUzunov opened this issue Apr 14, 2015 · 2 comments
Closed

Font color for numberDisplay chart #913

TeodorUzunov opened this issue Apr 14, 2015 · 2 comments

Comments

@TeodorUzunov
Copy link

Hello,
I was wondering if there is a way to set the font color for number display chart to depend of the value of the "%number". For example the color of the text should be in green if the value is positive and red if negative.
I am sorry if my question is not clear or has already been answered.
Thank you in advance.

@AlanKavanagh
Copy link
Contributor

It's not really something you should do directly with dc. Perhaps create a on('postRender') function to check the value and assign a styling based on this?

@gordonwoodhull
Copy link
Contributor

I agree with @AlanKavanagh, what we used to call a "renderlet" should work fine here. A "pretransition hook" (#806) will be even better, because you might see a delay before the color is applied with a postRender or renderlet.

I'll close this, but please ask on Stack Overflow with the dc.js tag, or on the user group if you can't get it to work.

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

No branches or pull requests

3 participants