# Change colors for each result on stacked bar?

**URL:** https://discuss.elastic.co/t/change-colors-for-each-result-on-stacked-bar/275598
**Category:** Kibana
**Created:** [June 10, 2021, 4:08pm UTC](https://discuss.elastic.co/t/change-colors-for-each-result-on-stacked-bar/275598 "2021-06-10T16:08:31Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![riahc3](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@riahc3](https://discuss.elastic.co/u/riahc3)
#### Post date: [June 10, 2021, 4:08pm UTC](https://discuss.elastic.co/t/change-colors-for-each-result-on-stacked-bar/275598/1 "2021-06-10T16:08:31Z")

</div>

Hello

I have stacked bar that is showing me success logons and failed logons. I want them to be different colors than the default but I dont see where I can change that.

How do I do it?

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [June 10, 2021, 5:12pm UTC](https://discuss.elastic.co/t/change-colors-for-each-result-on-stacked-bar/275598/2 "2021-06-10T17:12:06Z")

</div>

It depends on which visualization type you're using.

If you're using Lens in 7.13, you can get a custom color by using _metrics with filters_ instead of _breakdown by_. This is because the breakdown colors are not fully customizable, but the metrics are. Older versions of Lens do not support custom colors.

If you're using an aggregation-based chart type, you can click the color dot in the legend to assign a color by name.

If you're using TSVB, I would recommend an approach similar to Lens- create multiple series where each one is filtered by status, and then you can assign a custom color to each.

---

<div class="post-metadata">

### Author: ![riahc3](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@riahc3](https://discuss.elastic.co/u/riahc3)
#### Post date: [June 14, 2021, 10:30am UTC](https://discuss.elastic.co/t/change-colors-for-each-result-on-stacked-bar/275598/3 "2021-06-14T10:30:33Z")

</div>

So if I understand you correctly, if I want to make a stacked bar visualization with different colors for different results, I need at least 7.13?

I dont wanna make a chart/pie based visualization (I know that is possible) and TSVB I believe shows it in a timeline.

Thank you for your help as always.

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [June 14, 2021, 1:40pm UTC](https://discuss.elastic.co/t/change-colors-for-each-result-on-stacked-bar/275598/4 "2021-06-14T13:40:11Z")

</div>

In older versions where you want a stacked bar chart _without a time dimension on the X axis_ then you can use the aggregation-based Bar Chart visualization.

---

<div class="post-metadata">

### Author: ![riahc3](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@riahc3](https://discuss.elastic.co/u/riahc3)
#### Post date: [June 14, 2021, 3:15pm UTC](https://discuss.elastic.co/t/change-colors-for-each-result-on-stacked-bar/275598/5 "2021-06-14T15:15:29Z")

</div>

Im using 7.10 ..... Im not sure if the Bar Chart visualization exists....

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [June 14, 2021, 3:37pm UTC](https://discuss.elastic.co/t/change-colors-for-each-result-on-stacked-bar/275598/6 "2021-06-14T15:37:25Z")

</div>

That chart type is the oldest chart type in Kibana. When you click Visualize -\> Bar Chart you'll see it.

---

<div class="post-metadata">

### Author: ![riahc3](https://avatars.discourse-cdn.com/v4/letter/r/d6d6ee/32.png) [@riahc3](https://discuss.elastic.co/u/riahc3)
#### Post date: [June 15, 2021, 8:10am UTC](https://discuss.elastic.co/t/change-colors-for-each-result-on-stacked-bar/275598/7 "2021-06-15T08:10:37Z")

</div>

I apoligize but I must be blind:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/4/c4a77a5d96c6a780883c90876eefdd862a703df0.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/2/a2bfe2158410bd2ced779f39d795c143770e19eb.png)

If I click on Vertical Bar, I have the issue I mention: I cannot set different colors for different results.

---

<div class="post-metadata">

### Author: ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)
#### Post date: [June 16, 2021, 3:24pm UTC](https://discuss.elastic.co/t/change-colors-for-each-result-on-stacked-bar/275598/8 "2021-06-16T15:24:20Z")

</div>

You can click the color dot in the Vertical Bar legend to assign a unique color.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 14, 2021, 3:24pm UTC](https://discuss.elastic.co/t/change-colors-for-each-result-on-stacked-bar/275598/9 "2021-07-14T15:24:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
