# Tree Vega - Change the path color based on field condition

**URL:** <https://discuss.elastic.co/t/tree-vega-change-the-path-color-based-on-field-condition/328452>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [March 24, 2023, 11:34am UTC](https://discuss.elastic.co/t/tree-vega-change-the-path-color-based-on-field-condition/328452 "2023-03-24T11:34:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimple.P](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@Dimple.P](https://discuss.elastic.co/u/Dimple.P)\
**Post date:** [March 24, 2023, 11:34am UTC](https://discuss.elastic.co/t/tree-vega-change-the-path-color-based-on-field-condition/328452/1 "2023-03-24T11:34:08Z")

</div>

Is it possible to alter the path colour of Tree Vega chart depending on a data field where the condition is, flag == 1 imply path should be in red else black in colour, I used the following code for the node and it works good, but I wanted to implement the same for pathways as well, Please advise.

```auto
"stroke": [
            {"test": "datum._source.flag==1", "value": "#de040c"},
            {"value": "#10a5e6"}
          ]

```

---

<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:** [April 21, 2023, 11:34am UTC](https://discuss.elastic.co/t/tree-vega-change-the-path-color-based-on-field-condition/328452/2 "2023-04-21T11:34:39Z")

</div>

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