Dataset colors: option for different colors for negative values?

If 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?

Author: Fantashit

7 thoughts on “Dataset colors: option for different colors for negative values?

  1. +1 This is exactly what I need, I found a script to extend the line chart for v1.x but it’s not working anymore for v2.x
    It could be nice to have fillPositive: and fillNegative option, and of course backgroundColorPositive, backgroundColorNegative.

  2. @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

  3. 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.

Comments are closed.