# Is possible to use gradient in bar charts?

**URL:** <https://community.plotly.com/t/is-possible-to-use-gradient-in-bar-charts/48698>\
**Category:** plotly.js\
**Created:** [January 5, 2021, 2:34pm UTC](https://community.plotly.com/t/is-possible-to-use-gradient-in-bar-charts/48698 "2021-01-05T14:34:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevinmike](https://avatars.discourse-cdn.com/v4/letter/k/e68b1a/32.png) [@kevinmike](https://community.plotly.com/u/kevinmike)\
**Post date:** [January 5, 2021, 2:34pm UTC](https://community.plotly.com/t/is-possible-to-use-gradient-in-bar-charts/48698/1 "2021-01-05T14:34:07Z")

</div>

Hi. I am wondering if is possible to use a gradient in bar charts instead of using solid colors. I was reading the documentation, however I just could find examples using a color scale with heatmaps. I would like to use something similar, but with bar charts.

Example  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/f/f320f4b9a42a2770a2e18a53fb5d64d458d19a38.png)

---

<div class="post-metadata">

**Author:** ![gonzalo](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@gonzalo](https://community.plotly.com/u/gonzalo)\
**Post date:** [August 1, 2023, 11:00am UTC](https://community.plotly.com/t/is-possible-to-use-gradient-in-bar-charts/48698/2 "2023-08-01T11:00:12Z")

</div>

I have the same question (for Plotly R though), but I have not found any clue.

I have found some similar questions for Plotly Python in the community but none of them have any comments let alone answers. Perhaps is useful to have them linked here:

> [@Bar Chart: Gradient Color in Data Bars](https://community.plotly.com/t/bar-chart-gradient-color-in-data-bars/43552):
>
> I am doing what I thought was a pretty simple visualization as I am pretty new to python and plotly. I am just taking some county covid data, calculating the rate per 100K population and bar graphing it. So far so easy. What I wanted to end up with are individual bars for each county that go from green to yellow to red as they have a higher number. When the number reaches 100 it should be solid red (in the “red zone”) from 100 to however high it goes. It should look something like this (but wit…

> [@Fill bars with color gradient in Python](https://community.plotly.com/t/fill-bars-with-color-gradient-in-python/4391):
>
> Is there a way to fill the bars created by Plotly Python API with a color gradient instead of a single color cf. attachment?

Also, there are two questions in SO that might help those using Dash Python, though I am not sure they solve the same problem:

> <https://stackoverflow.com/questions/68351754/how-to-add-colorscale-to-bar-graph-in-dash-python>

> <https://stackoverflow.com/questions/68039420/dash-plotly-css-customize-marker-style-gradient-color-for-bar-chart>

---

<div class="post-metadata">

**Author:** ![farispriadi](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/farispriadi/32/26759_2.png) [@farispriadi](https://community.plotly.com/u/farispriadi)\
**Post date:** [November 6, 2024, 1:45pm UTC](https://community.plotly.com/t/is-possible-to-use-gradient-in-bar-charts/48698/3 "2024-11-06T13:45:56Z")

</div>

Hi,

Here is the an option to create that kind of bar charts with Plotly Python that maybe useful.

> [@Bar Chart: Gradient Color in Data Bars](https://community.plotly.com/t/bar-chart-gradient-color-in-data-bars/43552/2):
>
> Hi, Fortunately, today I have same problem, and bump into this post. I want to share something that I have been working on all day, to you and all community members that maybe had same problem. I think it’s still relevant to reply this thread, even this post created 4 years ago. As far as I know, until now, you can not create this kind of bar chart with just adding some attributes. But, I have a solution that you need more work with the data. Suppose I have this animal population datafram…
