# Dashboard chart colours (again)

**URL:** <https://discourse.nodered.org/t/dashboard-chart-colours-again/92375>\
**Category:** Dashboard\
**Tags:** feature-request, dashboard-2\
**Created:** [14 October 2024 13:30 UTC](https://discourse.nodered.org/t/dashboard-chart-colours-again/92375 "2024-10-14T13:30:35Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [23 October 2024 13:24 UTC](https://discourse.nodered.org/t/dashboard-chart-colours-again/92375/21 "2024-10-23T13:24:44Z")

</div>

My final thoughts on this.

> [@joepavitt](#):
>
> prevent the _need_ for modifications to any underlying data structures

Well yes, understood and the chart is much better for you taking that approach.  
But I'm not suggesting anyone is _required_ to supply colour or any other value.

In the spirit of allowing more dynamic charts, consider feeding a bar chart from an SQL query:

```auto
select timestamp, temperature, case when temperature > 100 then "red" else "green" end as color from test;

```

If the chart config "Series" was "None" you could use this to get red bars when above 100, green when below.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/c/0c8b9259bb2deec192fd50275b31c2142bd2d10c.png)

I use bar colours to help visually correlate the same event plotted on two charts and displayed in a table. I display 1 bar per day for the past month. 9 colours works for this but is not ideal.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/f/cf873fd1741590d31c7883647bad37c8d84a0960.png)

For unique colours that implies 31 rows in the editable list.  
Not ideal to define 31 colours in the SQL query (or in a function node) either, possible though.

I could also ensure that a bar for Monday is always red, Tuesday green, ...  
I can't see how that is possible with a rolling dataset using the editable list approach.

### Other chart types
I don't know what data you have to feed a pie chart with but a similar approach to colour the slices. {{nation:"USA", population: 200, "color": "blue"}, {nation: "China", population: 1500, color: "red"}, ...}

For a line chart, hmm. The analogue is colour & style of the points, I'm not sure how this would relate to the line colour, which applies to the entire data set not individual points.

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [23 October 2024 13:57 UTC](https://discourse.nodered.org/t/dashboard-chart-colours-again/92375/22 "2024-10-23T13:57:11Z")

</div>

Good point, well presented - thanks @jbudd

---

<div class="post-metadata">

**Author:** ![samos](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@samos](https://discourse.nodered.org/u/samos)\
**Post date:** [30 October 2024 20:30 UTC](https://discourse.nodered.org/t/dashboard-chart-colours-again/92375/23 "2024-10-30T20:30:00Z")

</div>

Bart, I understand. At the minute, I'm okay with the capabilities that is already supplied, so on that, thankyou.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [8 May 2025 14:13 UTC](https://discourse.nodered.org/t/dashboard-chart-colours-again/92375/24 "2025-05-08T14:13:49Z")

</div>

Is there any likelihood of this being included with work for Node-red v5?

[Previous page](https://discourse.nodered.org/t/dashboard-chart-colours-again/92375.md?page=1)
