# Can we assign colors to specific fields in kibana?

**URL:** https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624
**Category:** Kibana
**Tags:** dashboard, visualisation
**Created:** [March 14, 2023, 4:54am UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624 "2023-03-14T04:54:54Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![smchamberlin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smchamberlin/32/118329_2.png) [@smchamberlin](https://discuss.elastic.co/u/smchamberlin)
#### Post date: [March 14, 2023, 4:54am UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624/1 "2023-03-14T04:54:54Z")

</div>

Hello,

I can see how to select a color palette for a kibanaq dashboard lens visualization, but what I'd really like to be able to do is choose a particular field (like a "bad" field) and assign it red, and choose a "good" field and assign it green. I can't figure out how to do - is it possible?

Thanks!

---

<div class="post-metadata">

### Author: ![drewdaemon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewdaemon/32/97779_2.png) [@drewdaemon](https://discuss.elastic.co/u/drewdaemon)
#### Post date: [April 10, 2023, 8:41pm UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624/2 "2023-04-10T20:41:06Z")

</div>

Hi @smchamberlin ! This is on our immediate roadmap, so we hope to have this capability soon! You can watch this issue to track our progress: [[Lens] Support categorical coloring by name · Issue #101942 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/101942)

In the meantime, there is a bit of an inelegant workaround. It may or may not work for you.

You should be able to use [runtime fields]([https://runtime](https://runtime) fields) added to your data view to map specific values to specific ranges and color based on those numeric ranges. You could have a table with two columns where one cell on each row displays the value and the other mapped value and the corresponding color.

Let me know if you have any more questions!

---

<div class="post-metadata">

### Author: ![vdashora](https://avatars.discourse-cdn.com/v4/letter/v/db5fbb/32.png) [@vdashora](https://discuss.elastic.co/u/vdashora)
#### Post date: [April 21, 2023, 7:09pm UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624/3 "2023-04-21T19:09:19Z")

</div>

Hi Andrew,

Is there an active example of how to utilize runtime fields in our dashboards? The documentation says it can be done without changing the code, but everything I see requires some API configuration. Could I get a bit more clarity on this? Much appreciated.

---

<div class="post-metadata">

### Author: ![drewdaemon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewdaemon/32/97779_2.png) [@drewdaemon](https://discuss.elastic.co/u/drewdaemon)
#### Post date: [April 25, 2023, 4:15pm UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624/4 "2023-04-25T16:15:26Z")

</div>

You can add a field from the data view menu

 ![Screenshot 2023-04-25 at 11.13.00 AM](https://us1.discourse-cdn.com/elastic/original/3X/6/8/6812c6ebc133f87c481813e7b723f93826362a9d.png)

Or from the data view management page

 ![Screenshot 2023-04-25 at 11.12.02 AM](https://us1.discourse-cdn.com/elastic/original/3X/d/b/dbe65dbef44832d200e0d160edd9cf820e963683.png)

When the flyout opens, give your field a name and a type and toggle on "Set value." There, you define your field with a script.

 ![Screenshot 2023-04-25 at 11.12.38 AM](https://us1.discourse-cdn.com/elastic/original/3X/5/b/5b866b1b6921bf4252cbff0883fe66e3bdc79b15.png)

Does this help?

---

<div class="post-metadata">

### Author: ![vdashora](https://avatars.discourse-cdn.com/v4/letter/v/db5fbb/32.png) [@vdashora](https://discuss.elastic.co/u/vdashora)
#### Post date: [April 27, 2023, 12:06am UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624/5 "2023-04-27T00:06:00Z")

</div>

Hey Andrew,

Thanks for the response, I see where to edit the script but I still have a few questions.

1). Where do I specify color? So if I suppose have values that are ranging between 1-50 and I want them to be green, and 51-100 and have them be red, where and how do I specify that in the script/service?

2). If I create this runtime field, how do I apply it to the graph on my dashboard?

3). We update our data via Jenkins scripts every 24 hours, would we need to modify the particular graph we're editing with the runtime field manually?

---

<div class="post-metadata">

### Author: ![smchamberlin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smchamberlin/32/118329_2.png) [@smchamberlin](https://discuss.elastic.co/u/smchamberlin)
#### Post date: [May 12, 2023, 8:35pm UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624/6 "2023-05-12T20:35:02Z")

</div>

Thanks Andrew! I have the same questions as Vidhu ... Where do we specify the color, and how does that field get picked up/applied in the dashboard?

Also is there an ETA on when the color mapping feature would be made available? Very glad to hear it's being considered.

Thanks!

---

<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: [June 9, 2023, 8:35pm UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624/7 "2023-06-09T20:35:40Z")

</div>

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

---

<div class="post-metadata">

### Author: ![drewdaemon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewdaemon/32/97779_2.png) [@drewdaemon](https://discuss.elastic.co/u/drewdaemon)
#### Post date: [August 2, 2023, 7:43pm UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624/8 "2023-08-02T19:43:21Z")

</div>

> [@smchamberlin](#):
>
> Also is there an ETA on when the color mapping feature would be made available? Very glad to hear it's being considered.

Most possible target for MVP (assigning colors by term) is 8.11.

---

<div class="post-metadata">

### Author: ![drewdaemon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewdaemon/32/97779_2.png) [@drewdaemon](https://discuss.elastic.co/u/drewdaemon)
#### Post date: [August 2, 2023, 7:52pm UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624/9 "2023-08-02T19:52:21Z")

</div>

> [@vdashora](#):
>
> 1). Where do I specify color? So if I suppose have values that are ranging between 1-50 and I want them to be green, and 51-100 and have them be red, where and how do I specify that in the script/service?

This is possible today for numeric data without bringing in a runtime field.

The only reason I brought up runtime fields was because I thought we were talking about string or keyword fields—"bad" and "good" for example, in which case you would currently have to map those to numeric values. Support for coloring by terms ("bad" or "good," etc) is what is coming in [[Lens] Support categorical coloring by name · Issue #101942 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/101942).

My apologies if I misunderstood the intent of this topic!

You can easily define color ranges _for numeric data_ in Lens.

Take this example of a metric visualization.

First, select "Dynamic" under "Color mode."

 ![Screenshot 2023-08-02 at 1.46.56 PM](https://us1.discourse-cdn.com/elastic/original/3X/e/6/e666f667ebceca7e7480f3821f7942d7b7000586.png)

Then, click the palette bar.

 ![Screenshot 2023-08-02 at 1.47.24 PM](https://us1.discourse-cdn.com/elastic/original/3X/b/5/b5c7bbc4e939e7d864c5b0535cd189ae6e19257a.png)

This will open the palette editing interface where you can edit what colors should be assigned to what numeric ranges.

 ![Screenshot 2023-08-02 at 1.48.11 PM](https://us1.discourse-cdn.com/elastic/original/3X/b/6/b6d684121f04fc208328a44a1626c623592f9147.png)

Let me know if this helps.

---

<div class="post-metadata">

### Author: ![drewdaemon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewdaemon/32/97779_2.png) [@drewdaemon](https://discuss.elastic.co/u/drewdaemon)
#### Post date: [August 2, 2023, 7:52pm UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624/10 "2023-08-02T19:52:57Z")

</div>



---

<div class="post-metadata">

### Author: ![vdashora](https://avatars.discourse-cdn.com/v4/letter/v/db5fbb/32.png) [@vdashora](https://discuss.elastic.co/u/vdashora)
#### Post date: [October 25, 2023, 9:14pm UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624/11 "2023-10-25T21:14:42Z")

</div>

Hi Andrew!

Thank you so much for this, I think it will definitely help us when we need to create color mapping based on numbers. That being said, we currently have a graph where we have 20 entries, in our case Customer Scenario's (CD1-Cd50 for example), and each have a set number of "open" or "closed" issues.

**red: open**  
**closed: green**

The data is shown in the proper color at high level, but when drilling down it chooses only one color.

So if I hit CD59, which is mostly open issues so mostly red, it shows me a green vs red breakdown:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/b/1be7b938631e92b8ef19eeeb8fcb8195f780e360.png)

but when I click on the RED, the whole graph turns green:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/9/19510ddf0779e8544a33b8f85ebba5f368747b3c.png)

So perhaps the above assigning words to colors might help, has that been updated and available since I see the ticket is closed? If so, how would I best go about that?

So I see above that the issue has been closed, has the functionality to assign WORDS to colors been integrated yet?

---

<div class="post-metadata">

### Author: ![vdashora](https://avatars.discourse-cdn.com/v4/letter/v/db5fbb/32.png) [@vdashora](https://discuss.elastic.co/u/vdashora)
#### Post date: [January 9, 2024, 9:19pm UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624/12 "2024-01-09T21:19:00Z")

</div>

Hey @drewdaemon

Has Support for coloring by terms ("bad" or "good," etc) is what is coming in [[Lens] Support categorical coloring by name · Issue #101942 · elastic/kibana · GitHub ](https://github.com/elastic/kibana/issues/101942) been made available in a specific version? If so we can update our stack to that version.

thanks!

---

<div class="post-metadata">

### Author: ![erikg](https://avatars.discourse-cdn.com/v4/letter/e/91b2a8/32.png) [@erikg](https://discuss.elastic.co/u/erikg)
#### Post date: [January 10, 2024, 3:32pm UTC](https://discuss.elastic.co/t/can-we-assign-colors-to-specific-fields-in-kibana/327624/13 "2024-01-10T15:32:00Z")

</div>

It was made available in 8.11  
[[Lens] Color mapping for categorical dimensions by markov00 · Pull Request #162389 · elastic/kibana (github.com)](https://github.com/elastic/kibana/pull/162389)
