tremorlabs / tremor

React components to build charts and dashboards
https://tremor.so
Apache License 2.0
15.65k stars 452 forks source link

[Feature]: Add color override for [bar] charts #969

Open imclint21 opened 4 months ago

imclint21 commented 4 months ago

What problem does this feature solve?

Would be nice to have the possibility to specify a specific color for an item in the [bar] chart, by example would be nice to have some bar here in red:

image

What does the proposed API look like?

colorOverride={[{"item1": "red"]}
parisosuch-dev commented 3 months ago

I second this idea. In what context is the item. Is that a specific value on the x-axis or a specific value range on the y-axis.

I for one would want a feature that can color a bar based on another property in a data point. For example, you are given a list of data points that contain the execution time, the date, and the pass/fail of that execution. The bar would be colored based on the pass/fail. Would this be different than your proposed idea?

imclint21 commented 3 months ago

Not really, I just want the ability to change some bars depending of some conditions.

parisosuch-dev commented 3 months ago

Not really, I just want the ability to change some bars depending of some conditions.

I think this is solvable and a great feature. The Override would accept a list of x-axis values what that color should be.