# Change background color and text conditionally - OpenSearch Dashboard

**URL:** https://discuss.elastic.co/t/change-background-color-and-text-conditionally-opensearch-dashboard/297262
**Category:** Elasticsearch
**Created:** [February 15, 2022, 3:01pm UTC](https://discuss.elastic.co/t/change-background-color-and-text-conditionally-opensearch-dashboard/297262 "2022-02-15T15:01:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Raphael\_Carneiro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raphael_carneiro/32/101842_2.png) [@Raphael\_Carneiro](https://discuss.elastic.co/u/Raphael_Carneiro)
#### Post date: [February 15, 2022, 3:01pm UTC](https://discuss.elastic.co/t/change-background-color-and-text-conditionally-opensearch-dashboard/297262/1 "2022-02-15T15:01:35Z")

</div>

Hi,  
I want to build a very simple visualization based on Count aggregation to be added to a dashboard. This visualization should look just like this:

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

This text and background should change between OK/NOK based on a condition. Example: Set background to [red] and text to ["NOK"] if metric is [less than] [1].

Can anyone please advise me which component can achive this type of conditional formatting? I've tryied with TSVB Metric which I can easily change the background color, but not the text.

I appreciate any help.  
Thanks in advance.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 15, 2022, 8:40pm UTC](https://discuss.elastic.co/t/change-background-color-and-text-conditionally-opensearch-dashboard/297262/2 "2022-02-15T20:40:38Z")

</div>

Welcome to our community! 😃

Opensearch is an aws product and you will need to ask them about support sorry.

---

<div class="post-metadata">

### Author: ![Raphael\_Carneiro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raphael_carneiro/32/101842_2.png) [@Raphael\_Carneiro](https://discuss.elastic.co/u/Raphael_Carneiro)
#### Post date: [February 15, 2022, 11:13pm UTC](https://discuss.elastic.co/t/change-background-color-and-text-conditionally-opensearch-dashboard/297262/5 "2022-02-15T23:13:52Z")

</div>

Thank you @warkolm for your response.

I wonder how would this be done in Kibana then. Do you have any advise?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [February 16, 2022, 7:28am UTC](https://discuss.elastic.co/t/change-background-color-and-text-conditionally-opensearch-dashboard/297262/6 "2022-02-16T07:28:51Z")

</div>

If I remember correctly, some similar features are coming to Kibana 8.1+ in the Lens visualization.

May be ask in #elastic-stack:kibana?

---

<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: [March 16, 2022, 7:29am UTC](https://discuss.elastic.co/t/change-background-color-and-text-conditionally-opensearch-dashboard/297262/7 "2022-03-16T07:29:32Z")

</div>

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