-
Notifications
You must be signed in to change notification settings - Fork 356
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
How to display label data ONLY if the value is negative? #3947
Comments
I found this workaround, however is there another better solution?
however it display in white color, I should want nothing or transparent color What about this?
|
@Phil353556, if want to show only negative value, use bb.generate({
data: {
columns: [
["data1", 30, -200, -100, 400, 150, 250],
["data2", -50, 150, -150, 150, -50, -150]
],
labels: {
format: v => v < 0 ? v : null
}
}
}) |
Hi @netil, Another question, how to add a comment on a graph? comment comment comment comment
Phil |
If you're finding solution from the option, you can use |
Hello @netil Of course this is working: however the value is not written in red color but with the color of the line. |
for color, need to specify bb.generate({
data: {
columns: [
["data1", 30, -200, -100, 400, 150, 250],
["data2", -50, 150, -150, 150, -50, -150]
],
labels: {
format: v => v < 0 ? v : null,
colors: "red"
}
}
}); |
That's perfect, thank you so much. |
Hello,
I look at the example and modify to have a negative value and to make the color red if <0

https://naver.github.io/billboard.js/demo/#Data.DataLabelColors
It works, of course, however I should like to display the label ONLY for negative values otherwise, it can be unreadable.

as we can see on this screenshot
Is it possible to do that and how to modify these lines?
Thank you so much
Phil
The text was updated successfully, but these errors were encountered: