# Threshold value for color conditioning to be taken from a variable/field rather than giving direct number

**URL:** <https://discuss.elastic.co/t/threshold-value-for-color-conditioning-to-be-taken-from-a-variable-field-rather-than-giving-direct-number/255585>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [November 16, 2020, 6:50pm UTC](https://discuss.elastic.co/t/threshold-value-for-color-conditioning-to-be-taken-from-a-variable-field-rather-than-giving-direct-number/255585 "2020-11-16T18:50:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pranusha119](https://avatars.discourse-cdn.com/v4/letter/p/47e85d/32.png) [@Pranusha119](https://discuss.elastic.co/u/Pranusha119)\
**Post date:** [November 16, 2020, 6:50pm UTC](https://discuss.elastic.co/t/threshold-value-for-color-conditioning-to-be-taken-from-a-variable-field-rather-than-giving-direct-number/255585/1 "2020-11-16T18:50:28Z")

</div>

```auto
     "color": {
       "condition": {
         "test": {"field": "PercentOfTotal", "gt": 70},
         "value": "#B22222"
       },
       "value": "#006400"
     }

```

By this way I am able to do color conditioning

```auto
     "color": {
        "condition": {
          "test": {"field": "PercentOfTotal", "lt": datum.a_max},
          "value": "#006400"
        },
        "value": "#B22222"
      }
      }

```

When I am taking conditioning value from a variable(a\_max field created using max aggregation), it's giving default color.

Is there any way where I can take threshold value for color conditioning from a variable/field rather than giving direct number.

---

<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:** [December 14, 2020, 6:50pm UTC](https://discuss.elastic.co/t/threshold-value-for-color-conditioning-to-be-taken-from-a-variable-field-rather-than-giving-direct-number/255585/2 "2020-12-14T18:50:31Z")

</div>

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