# Solid to dashed-line on chart

**URL:** <https://discourse.nodered.org/t/solid-to-dashed-line-on-chart/19023>\
**Category:** Dashboard\
**Created:** [11 December 2019 14:58 UTC](https://discourse.nodered.org/t/solid-to-dashed-line-on-chart/19023 "2019-12-11T14:58:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davebanthorpe](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@davebanthorpe](https://discourse.nodered.org/u/davebanthorpe)\
**Post date:** [11 December 2019 14:58 UTC](https://discourse.nodered.org/t/solid-to-dashed-line-on-chart/19023/1 "2019-12-11T14:58:35Z")

</div>

Is it possible to change a line chart format from solid line to dashed line and back to solid dynamically? I have a data feed that has a validity state - rather then just sending null value to the chart if it is false, I want to retain the last valid value and draw that with a dashed line so we visually show the data is not valid.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [11 December 2019 15:33 UTC](https://discourse.nodered.org/t/solid-to-dashed-line-on-chart/19023/2 "2019-12-11T15:33:33Z")

</div>

Dashed line is possible but will be much more complicated than for example color change.  
Here is example of change color by value over threshold but it is up to you what will be the trigger of the change.  
[https://flows.nodered.org/flow/ea40616a1042f96c3018542a44735c90](https://flows.nodered.org/flow/ea40616a1042f96c3018542a44735c90)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [11 December 2019 16:17 UTC](https://discourse.nodered.org/t/solid-to-dashed-line-on-chart/19023/3 "2019-12-11T16:17:19Z")

</div>

or you can send null values to leave blanks in the chart where there are no readings.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [11 December 2019 16:29 UTC](https://discourse.nodered.org/t/solid-to-dashed-line-on-chart/19023/4 "2019-12-11T16:29:27Z")

</div>

Fact is that line is always and constantly with same style. So for dashed line in between, you will need to tweak it basically with same way as done in color change example. Difference is that for dashed line you'll need to change chart options via `msg.ui_control`  
[https://www.chartjs.org/docs/latest/charts/line.html#line-styling](https://www.chartjs.org/docs/latest/charts/line.html#line-styling)
