# Graph Line Changing Color Based On Value

**URL:** <https://forums.losant.com/t/graph-line-changing-color-based-on-value/5565>\
**Category:** Feature Request\
**Tags:** dashboard\
**Created:** [August 14, 2024, 1:48pm UTC](https://forums.losant.com/t/graph-line-changing-color-based-on-value/5565 "2024-08-14T13:48:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanner\_Williams](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tanner\_Williams](https://forums.losant.com/u/Tanner_Williams)\
**Post date:** [August 14, 2024, 1:48pm UTC](https://forums.losant.com/t/graph-line-changing-color-based-on-value/5565/1 "2024-08-14T13:48:26Z")

</div>

> [@Color of time series graph](https://forums.losant.com/t/color-of-time-series-graph/2739):
>
> I think it would be nice if the line in a time series graph could change color based on critical levels. i.e, change from black to red if a critical level has been reached, similar to the gauges.

Just saw this post and was wondering if there was any update to this?  
I’ve also considered using three different line segments and having them only display if there values are about a certain value. And while this  
`({{value}} > 85) * {{value}}`  
gets 100-85 or 0  
I wish it was something more like this  
`{{value}} > 85 ? {{value}} : undefined`  
Which would be 100-85, or no value displayed at all, but ternary doesn’t work as far as I can tell in the graph expressions

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [August 14, 2024, 3:05pm UTC](https://forums.losant.com/t/graph-line-changing-color-based-on-value/5565/2 "2024-08-14T15:05:05Z")

</div>

Sorry, no updates on that old feature request.

I’ve been playing with our expression testers for the past 30 minutes and I cannot come up with anything better than your workaround of `({{value}} > 85) * {{value}}`. You are correct that you cannot use ternaries in expressions; I’m going to see if that is something we can resolve.

---

<div class="post-metadata">

**Author:** ![Tanner\_Williams](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@Tanner\_Williams](https://forums.losant.com/u/Tanner_Williams)\
**Post date:** [August 14, 2024, 5:24pm UTC](https://forums.losant.com/t/graph-line-changing-color-based-on-value/5565/3 "2024-08-14T17:24:49Z")

</div>

I also just tried  
`{{value}} / ( {{value}} > 85)`  
Which just evaluated out to `{{value}}`  
even  
`{{value}}/0}}`  
evaluates to `{{value}}`  
typing in just  
`undefined`  
evaluates to 0 which is guess is the truthiness, specifically for this uses case of merging the different color lines I was hoping there was a way for it to not display a value at all but that probably doesnt make sense in a broader scope or if the colors could change based on value
