Dataset colors: option for different colors for negative values?
See original GitHub issueIf I’m charting an account balance in a line/bar chart, it’d be nice to show positive values in, say, black and negative values in, say, red. Right now that doesn’t seem to be an option. The thresholds/ranges should eventually be configurable so that 0
isn’t the only threshold and that there could be multiple ranges/bands of fills. This might only be for fills. Fill color boundaries could be abrupt or possibly a gradient mesh effect?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:23 (12 by maintainers)
Top Results From Across the Web
3.5 Coloring Negative and Positive Bars Differently
You want to use different colors for negative and positive-valued bars. 3.5.2 Solution. We'll use a subset of the climate data and create...
Read more >How to set different colors to positive and negative numbers in ...
In this guide, we're going to show you how to set different colors to positive and negative numbers in a column chart.
Read more >Chart.js Line, different fill color for negative point
Chart does not support doing that, as far as I know. There's only one color (well, one set of colors, for different details)...
Read more >Vary the colors of same-series data markers in a chart
To use different colors for each data marker, you can vary the colors automatically by using the Vary colors by point or Vary...
Read more >How to show Negative numbers in Red color in Google Sheets
The color of other values (having data 0 or greater than 0) will not change. Apart from that, whenever you will update the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing since this is doable manually. At this point, I don’t think we’ll build this into core directly. It could certainly live in user space though as a plugin.
@matfrog you can do this manually in v2.
When you set the
backgroundColor
property of the dataset, set it as an array of colors. The first color in the array will be used for the first bar, the second color for the second bar, etc