# Usability of ui-text vs ui-chart

**URL:** <https://discourse.nodered.org/t/usability-of-ui-text-vs-ui-chart/91233>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [24 September 2024 13:49 UTC](https://discourse.nodered.org/t/usability-of-ui-text-vs-ui-chart/91233 "2024-09-24T13:49:43Z")\
**Posts on this page:** 6\
**Page:** 1

<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:** [24 September 2024 13:49 UTC](https://discourse.nodered.org/t/usability-of-ui-text-vs-ui-chart/91233/1 "2024-09-24T13:49:43Z")

</div>

I think there has been some prior discussion of this topic, is the current situation set in stone?

The DB2 **ui-chart** has config fields for x and y series.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/8/e876a0a6040e593ff6e579e7ed041ac67ba56aca.png)  
This makes it very easy to specify a chart from stored data eg an SQL query  
`select day, finalWh from mytable`

Much much better than DB1 ui-chart!

In contrast, DB2's **ui-text** does not have a value config field, it can only display msg.payload.  
So we often need a change node to move some other property into msg.payload.

I know that DB1's processing of the value field uses the mustache syntax from Angular which is not available for DB2 but just being able to select which property to display would make it much easier.

Note: my hint of an SQL query as the source of the data is deliberate. I can (probably) tweek the query so that a field value of `49.55572` is returned as `"49.56 kWh"`  
But it will be returned as an array.  
The text field cannot display msg.payload[0] unaided.

---

<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:** [24 September 2024 14:04 UTC](https://discourse.nodered.org/t/usability-of-ui-text-vs-ui-chart/91233/2 "2024-09-24T14:04:06Z")

</div>

> [@jbudd](#):
>
> Much much better than DB1 ui-chart!

❤

> [@jbudd](#):
>
> In contrast, DB2's **ui-text** does not have a value config field, it can only display msg.payload.  
> So we often need a change node to move some other property into msg.payload.

@Steve-Mcl has done some great work on this and has a [PR open](https://github.com/FlowFuse/node-red-dashboard/pull/1237) - it's a beast, and I need to spend some good time digesting it, but it's an area that will hopefully improve in the very near future

---

<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:** [24 September 2024 14:39 UTC](https://discourse.nodered.org/t/usability-of-ui-text-vs-ui-chart/91233/3 "2024-09-24T14:39:26Z")

</div>

> [@joepavitt](#):
>
> > [@jbudd](#):
> >
> > Much much better than DB1 ui-chart!
> 
> ❤

Wouldn't like you to think I can only do negative Joe 😜

> [@joepavitt](#):
>
> it's an area that will hopefully improve in the very near future

👍

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [24 September 2024 15:49 UTC](https://discourse.nodered.org/t/usability-of-ui-text-vs-ui-chart/91233/4 "2024-09-24T15:49:48Z")

</div>

Isnt the `key` property inconsistent to the rest of node-red that uses `msg.` instead ?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 September 2024 16:07 UTC](https://discourse.nodered.org/t/usability-of-ui-text-vs-ui-chart/91233/5 "2024-09-24T16:07:04Z")

</div>

just different. FYI, the typedInput can have have custom types - which is what this node is doing)

It is related the chart lib used by the node.

for example, if your data comes straight from a database and looks like this:

```auto
[
  { id: 1, "value1": 12 , "value2": 22 },
  { id: 1, "value1": 51 , "value2": 33},
]

```

then strictly speaking, the keys are `value1` and `value2` not `msg.payload.value1`

If however you were sending a payload of ` { id: 1, "value1": 12 , "value2": 22 }` then you can use `msg.payload.value1` or a key of `value1`

TLDR  
It greatly simplifies DB queries

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 October 2024 16:07 UTC](https://discourse.nodered.org/t/usability-of-ui-text-vs-ui-chart/91233/6 "2024-10-24T16:07:44Z")

</div>

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