# Set Stat Panel Color by Field Label

**URL:** <https://community.grafana.com/t/set-stat-panel-color-by-field-label/54677>\
**Category:** Stat Panel\
**Tags:** stat-panel\
**Created:** [October 13, 2021, 2:00am UTC](https://community.grafana.com/t/set-stat-panel-color-by-field-label/54677 "2021-10-13T02:00:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![farzadpanahi](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/farzadpanahi/32/7844_2.png) [@farzadpanahi](https://community.grafana.com/u/farzadpanahi)\
**Post date:** [October 13, 2021, 2:00am UTC](https://community.grafana.com/t/set-stat-panel-color-by-field-label/54677/1 "2021-10-13T02:00:39Z")

</div>

I have queried data that looks like the following:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/8/0/8079cfc3764477cd7f8132775555f7d260cacf8e.png)

I want to use the “color” label I dynamically generate in my query to set the color of the panel. I looked into the Config From Query Results transformation but it doesn’t let you choose based on label. It is based on filed.

Is there a way to set the color field from a dynamically generated query?

---

<div class="post-metadata">

**Author:** ![farzadpanahi](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/farzadpanahi/32/7844_2.png) [@farzadpanahi](https://community.grafana.com/u/farzadpanahi)\
**Post date:** [October 13, 2021, 9:23pm UTC](https://community.grafana.com/t/set-stat-panel-color-by-field-label/54677/2 "2021-10-13T21:23:41Z")

</div>

According to [documentation](https://grafana.com/docs/grafana/latest/developers/plugins/data-frames/#field-configuration):

> ### Field configuration
> 
> Each field in a data frame contains optional information about the values in the field, such as units, scaling, and so on.
> 
> By adding field configurations to a data frame, Grafana can configure visualizations automatically. For example, you could configure Grafana to automatically set the unit provided by the data source.

So, what is it that I am missing here? As you can see in my previous message I have `color="green"` in my data frame. Why Grafana is not setting the color accordingly? Is there a syntax error here?

---

<div class="post-metadata">

**Author:** ![the-dude-abides](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/the-dude-abides/32/26359_2.png) [@the-dude-abides](https://community.grafana.com/u/the-dude-abides)\
**Post date:** [September 29, 2022, 1:46am UTC](https://community.grafana.com/t/set-stat-panel-color-by-field-label/54677/3 "2022-09-29T01:46:38Z")

</div>

Did you find a solution for this? I am looking for the same feature.

---

<div class="post-metadata">

**Author:** ![farzadpanahi](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/farzadpanahi/32/7844_2.png) [@farzadpanahi](https://community.grafana.com/u/farzadpanahi)\
**Post date:** [September 29, 2022, 2:41am UTC](https://community.grafana.com/t/set-stat-panel-color-by-field-label/54677/4 "2022-09-29T02:41:43Z")

</div>

I am using Rows to Fields transformation:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/6/e/6ea5fd515ccca4d7f421883747fe278261729e01.png)

Hope this helps!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/grafana/original/2X/e/ef5308cc58c9e5a13187b5012eb99f406928462f.png) [@system](https://community.grafana.com/u/system)\
**Post date:** [October 13, 2022, 2:00am UTC](https://community.grafana.com/t/set-stat-panel-color-by-field-label/54677/5 "2022-10-13T02:00:42Z")

</div>

Closed on October 13, 2022, 2:00am UTC

This topic was automatically closed after 365 days. New replies are no longer allowed.
