# How to display an array as graph/chart

**URL:** <https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808>\
**Category:** General\
**Created:** [7 December 2022 07:34 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808 "2022-12-07T07:34:28Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [7 December 2022 07:34 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/1 "2022-12-07T07:34:28Z")

</div>

Hi,  
I get different forecast: Tibber and Solecast.  
example:

```auto
[{"total":0.3723,"energy":0.2646,"tax":0.1077,"startsAt":"2022-12-07T00:00:00.000+01:00","currency":"EUR","level":"CHEAP"},{"total":0.3379,"energy":0.2357,"tax":0.1022,"startsAt":"2022-12-07T01:00:00.000+01:00","currency":"EUR","level":"CHEAP"},{"total":0.3001,"energy":0.2039,"tax":0.0962,"startsAt":"2022-12-07T02:00:00.000+01:00","currency":"EUR","level":"CHEAP"},{"total":0.2954,"energy":0.2,"tax":0.0954,"startsAt":"2022-12-07T03:00:00.000+01:00","currency":"EUR","level":"CHEAP"},{"total":0.3313,"energy":0.2302,"tax":0.1011,"startsAt":"2022-12-07T04:00:00.000+01:00","currency":"EUR","level":"CHEAP"},{"total":0.3661,"energy":0.2594,"tax":0.1067,"startsAt":"2022-12-07T05:00:00.000+01:00","currency":"EUR","level":"CHEAP"},{"total":0.3597,"energy":0.254,"tax":0.1057,"startsAt":"2022-12-07T06:00:00.000+01:00","currency":"EUR","level":"CHEAP"},{"total":0.468,"energy":0.345,"tax":0.123,"startsAt":"2022-12-07T07:00:00.000+01:00","currency":"EUR","level":"NORMAL"},{"total":0.5135,"energy":0.3833,"tax":0.1302,"startsAt":"2022-12-07T08:00:00.000+01:00","currency":"EUR","level":"NORMAL"},{"total":0.4688,"energy":0.3457,"tax":0.1231,"startsAt":"2022-12-07T09:00:00.000+01:00","currency":"EUR","level":"NORMAL"},{"total":0.4444,"energy":0.3252,"tax":0.1192,"startsAt":"2022-12-07T10:00:00.000+01:00","currency":"EUR","level":"NORMAL"},{"total":0.4204,"energy":0.305,"tax":0.1154,"startsAt":"2022-12-07T11:00:00.000+01:00","currency":"EUR","level":"NORMAL"},{"total":0.4107,"energy":0.2968,"tax":0.1139,"startsAt":"2022-12-07T12:00:00.000+01:00","currency":"EUR","level":"CHEAP"},{"total":0.442,"energy":0.3232,"tax":0.1188,"startsAt":"2022-12-07T13:00:00.000+01:00","currency":"EUR","level":"NORMAL"},{"total":0.543,"energy":0.4081,"tax":0.1349,"startsAt":"2022-12-07T14:00:00.000+01:00","currency":"EUR","level":"EXPENSIVE"},{"total":0.5771,"energy":0.4367,"tax":0.1404,"startsAt":"2022-12-07T15:00:00.000+01:00","currency":"EUR","level":"EXPENSIVE"},{"total":0.5977,"energy":0.4541,"tax":0.1436,"startsAt":"2022-12-07T16:00:00.000+01:00","currency":"EUR","level":"EXPENSIVE"},{"total":0.5563,"energy":0.4193,"tax":0.137,"startsAt":"2022-12-07T17:00:00.000+01:00","currency":"EUR","level":"EXPENSIVE"},{"total":0.5334,"energy":0.4,"tax":0.1334,"startsAt":"2022-12-07T18:00:00.000+01:00","currency":"EUR","level":"NORMAL"},{"total":0.5196,"energy":0.3884,"tax":0.1312,"startsAt":"2022-12-07T19:00:00.000+01:00","currency":"EUR","level":"NORMAL"},{"total":0.5439,"energy":0.4088,"tax":0.1351,"startsAt":"2022-12-07T20:00:00.000+01:00","currency":"EUR","level":"EXPENSIVE"},{"total":0.4467,"energy":0.3272,"tax":0.1195,"startsAt":"2022-12-07T21:00:00.000+01:00","currency":"EUR","level":"NORMAL"},{"total":0.4153,"energy":0.3007,"tax":0.1146,"startsAt":"2022-12-07T22:00:00.000+01:00","currency":"EUR","level":"CHEAP"},{"total":0.3913,"energy":0.2806,"tax":0.1107,"startsAt":"2022-12-07T23:00:00.000+01:00","currency":"EUR","level":"CHEAP"}]

```

is it possible to create a daily graph / course in NR?  
Y: total price  
X: time

like this:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/9/d9515a32ceda3400bf04b5adf5daf82e03e4b45f.png)

---

<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:** [7 December 2022 08:49 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/2 "2022-12-07T08:49:52Z")

</div>

Yes of course, you just need to convert the data into the right format for the dashboard chart node, as described [here](https://github.com/node-red/node-red-dashboard/blob/master/Charts.md#stored-data).

An example function to do this:

```auto
let mydata = msg.payload;
const chart = [{
    "series": ["Price"],
    "data": [
        mydata.map(e => { return { x: e.startsAt, y: e.total } }) 
    ],
    "labels": []
}];
msg.payload = chart;
return msg;

```

Using your data gives this chart

 ![Untitled 1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/9/e937387db62303a83071464b3c1e62c571202969.jpeg)

---

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [7 December 2022 11:06 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/3 "2022-12-07T11:06:11Z")

</div>

Thanx 🤩

do you know how I can send it to influx 1.6. each day ?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [7 December 2022 11:12 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/4 "2022-12-07T11:12:03Z")

</div>

There is an InfluxDB node that acts as a helper or you can do it yourself with an http request node as InfluxDB uses a REST API.

It is generally best to send InfluxDB data at the time of receipt rather than later though you can do that as well.

The question really though is whether you already have an InfluxDB database set up and ready to use. If not, you need to do that first. There are some threads on the forum that may help and an FAQ entry.

---

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [7 December 2022 14:15 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/5 "2022-12-07T14:15:22Z")

</div>

@jbudd  
I have another data stream:

```auto
{"forecasts":[{"pv_estimate":0.229,"pv_estimate10":0.1482,"pv_estimate90":0.7065,"period_end":"2022-12-07T14:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0.4994,"pv_estimate10":0.0886,"pv_estimate90":0.9187,"period_end":"2022-12-07T15:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0.0068,"period_end":"2022-12-07T15:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T16:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T16:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T17:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T17:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T18:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T18:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T19:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T19:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T20:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T20:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T21:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T21:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T22:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T22:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T23:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-07T23:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T00:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T00:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T01:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T01:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T02:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T02:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T03:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T03:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T04:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T04:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T05:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T05:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T06:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T06:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T07:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T07:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0.0411,"pv_estimate10":0.0137,"pv_estimate90":0.0795,"period_end":"2022-12-08T08:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0.1643,"pv_estimate10":0.0411,"pv_estimate90":0.4345,"period_end":"2022-12-08T08:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0.3213,"pv_estimate10":0.0838,"pv_estimate90":1.3162,"period_end":"2022-12-08T09:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0.5813,"pv_estimate10":0.1327,"pv_estimate90":2.3721,"period_end":"2022-12-08T09:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0.8947,"pv_estimate10":0.1956,"pv_estimate90":3.3218,"period_end":"2022-12-08T10:00:00.0000000Z","period":"PT30M"},{"pv_estimate":1.1461,"pv_estimate10":0.2444,"pv_estimate90":4.0808,"period_end":"2022-12-08T10:30:00.0000000Z","period":"PT30M"},{"pv_estimate":1.3128,"pv_estimate10":0.2724,"pv_estimate90":4.9174,"period_end":"2022-12-08T11:00:00.0000000Z","period":"PT30M"},{"pv_estimate":1.4434,"pv_estimate10":0.2933,"pv_estimate90":5.3134,"period_end":"2022-12-08T11:30:00.0000000Z","period":"PT30M"},{"pv_estimate":1.5262,"pv_estimate10":0.3143,"pv_estimate90":5.6234,"period_end":"2022-12-08T12:00:00.0000000Z","period":"PT30M"},{"pv_estimate":1.4434,"pv_estimate10":0.2933,"pv_estimate90":5.8358,"period_end":"2022-12-08T12:30:00.0000000Z","period":"PT30M"},{"pv_estimate":1.2099,"pv_estimate10":0.2346,"pv_estimate90":5.6014,"period_end":"2022-12-08T13:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0.8882,"pv_estimate10":0.1656,"pv_estimate90":5.274,"period_end":"2022-12-08T13:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0.5277,"pv_estimate10":0.0966,"pv_estimate90":4.8957,"period_end":"2022-12-08T14:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0.2724,"pv_estimate10":0.0489,"pv_estimate90":3.5171,"period_end":"2022-12-08T14:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0.0978,"pv_estimate10":0.014,"pv_estimate90":1.4934,"period_end":"2022-12-08T15:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0.0071,"period_end":"2022-12-08T15:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T16:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T16:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T17:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T17:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T18:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T18:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T19:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T19:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T20:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T20:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T21:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T21:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T22:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T22:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T23:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-08T23:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T00:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T00:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T01:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T01:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T02:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T02:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T03:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T03:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T04:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T04:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T05:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T05:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T06:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T06:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T07:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0,"pv_estimate10":0,"pv_estimate90":0,"period_end":"2022-12-09T07:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0.058,"pv_estimate10":0.0145,"pv_estimate90":0.0745,"period_end":"2022-12-09T08:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0.2219,"pv_estimate10":0.0429,"pv_estimate90":0.5086,"period_end":"2022-12-09T08:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0.409,"pv_estimate10":0.0787,"pv_estimate90":1.4126,"period_end":"2022-12-09T09:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0.6958,"pv_estimate10":0.1202,"pv_estimate90":2.4273,"period_end":"2022-12-09T09:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0.9855,"pv_estimate10":0.1697,"pv_estimate90":3.3679,"period_end":"2022-12-09T10:00:00.0000000Z","period":"PT30M"},{"pv_estimate":1.2295,"pv_estimate10":0.2165,"pv_estimate90":4.2655,"period_end":"2022-12-09T10:30:00.0000000Z","period":"PT30M"},{"pv_estimate":1.4197,"pv_estimate10":0.2584,"pv_estimate90":4.964,"period_end":"2022-12-09T11:00:00.0000000Z","period":"PT30M"},{"pv_estimate":1.5262,"pv_estimate10":0.2933,"pv_estimate90":5.3384,"period_end":"2022-12-09T11:30:00.0000000Z","period":"PT30M"},{"pv_estimate":1.5174,"pv_estimate10":0.3036,"pv_estimate90":5.5584,"period_end":"2022-12-09T12:00:00.0000000Z","period":"PT30M"},{"pv_estimate":1.423,"pv_estimate10":0.2829,"pv_estimate90":5.7067,"period_end":"2022-12-09T12:30:00.0000000Z","period":"PT30M"},{"pv_estimate":1.2337,"pv_estimate10":0.2484,"pv_estimate90":5.8673,"period_end":"2022-12-09T13:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0.9599,"pv_estimate10":0.1932,"pv_estimate90":5.274,"period_end":"2022-12-09T13:30:00.0000000Z","period":"PT30M"},{"pv_estimate":0.6176,"pv_estimate10":0.1257,"pv_estimate90":4.918,"period_end":"2022-12-09T14:00:00.0000000Z","period":"PT30M"},{"pv_estimate":0.3143,"pv_estimate10":0.0768,"pv_estimate90":3.5714,"period_end":"2022-12-09T14:30:00.0000000Z","period":"PT30M"}]}

```

but I don´t get it for the chart.  
Can you help ?

* * *

with Influx it´s maybe no good idea to write in future.  
I´m writing every minute values in influx, time is = now.

---

<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:** [7 December 2022 14:18 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/6 "2022-12-07T14:18:07Z")

</div>

> [@Becker](#):
>
> but I don´t get it for the chart.

I don't understand. What's the problem?

---

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [7 December 2022 14:52 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/7 "2022-12-07T14:52:13Z")

</div>

sry, I was to stupid, now I got it with a "change" before.

Can I do it without the change node before?

```auto
let mydata = msg.payload;
const chart = [{
    "series": ["PV"],
    "data": [
        mydata.map(e => { return { x: e.period_end, y: e.pv_estimate } })
    ],
    "labels": []
}];
msg.payload = chart;
return msg;

```

---

<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:** [7 December 2022 15:09 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/8 "2022-12-07T15:09:10Z")

</div>

mydata.map() in the function code iterates over an array of objects.  
For each array element it outputs the **element.startsAt** and **element.total** properties

In your first sample data, **msg.payload** is an array of objects.  
In your second sample data, **msg.payload.forecasts** is an array of objects.

---

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [7 December 2022 15:33 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/9 "2022-12-07T15:33:11Z")

</div>

👍  
Can I combine 2 of those arrays in one chart ?

---

<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:** [7 December 2022 15:51 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/10 "2022-12-07T15:51:23Z")

</div>

You can have multiple lines on one chart yes.  
Here is an example from my NR setup

```auto
let mydata = msg.payload;
const chart = [{
    "series": ["Forecast Min","Actual Min", "Forecast Max", "Actual Max"],
    "data": [
        mydata.map(e => { return { x: e.timestamp, y: e.forecastmin } }),
        mydata.map(e => { return { x: e.timestamp, y: e.actualmin } }),
        mydata.map(e => { return { x: e.timestamp, y: e.forecastmax } }),
        mydata.map(e => { return { x: e.timestamp, y: e.actualmax } }) 
    ],
    "labels": []
}];
msg.payload = chart;
return msg;

```

However that's getting the data for all four lines from a single input array.

I think you can have two function nodes feeding into a single chart. Each node defines data for a single line ( series:["PV"] or series:["Price"] )

---

<div class="post-metadata">

**Author:** ![Becker](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@Becker](https://discourse.nodered.org/u/Becker)\
**Post date:** [7 December 2022 18:19 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/11 "2022-12-07T18:19:58Z")

</div>

I don´t get it in one chart:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/9/19de6882b885d5effa57bad8eb83285759f71d0b.png)

Debug:

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/6/f6a3c277308d9addc78799959090ad1663b38779.png)

```auto
[{"series":["Preis morgen"],"data":[[{"x":"2022-12-08T00:00:00.000+01:00","y":0.3984},{"x":"2022-12-08T01:00:00.000+01:00","y":0.3915},{"x":"2022-12-08T02:00:00.000+01:00","y":0.3783},{"x":"2022-12-08T03:00:00.000+01:00","y":0.3786},{"x":"2022-12-08T04:00:00.000+01:00","y":0.3852},{"x":"2022-12-08T05:00:00.000+01:00","y":0.4142},{"x":"2022-12-08T06:00:00.000+01:00","y":0.4453},{"x":"2022-12-08T07:00:00.000+01:00","y":0.5335},{"x":"2022-12-08T08:00:00.000+01:00","y":0.5898},{"x":"2022-12-08T09:00:00.000+01:00","y":0.5978},{"x":"2022-12-08T10:00:00.000+01:00","y":0.5903},{"x":"2022-12-08T11:00:00.000+01:00","y":0.5884},{"x":"2022-12-08T12:00:00.000+01:00","y":0.5911},{"x":"2022-12-08T13:00:00.000+01:00","y":0.5908},{"x":"2022-12-08T14:00:00.000+01:00","y":0.5977},{"x":"2022-12-08T15:00:00.000+01:00","y":0.6012},{"x":"2022-12-08T16:00:00.000+01:00","y":0.6083},{"x":"2022-12-08T17:00:00.000+01:00","y":0.6503},{"x":"2022-12-08T18:00:00.000+01:00","y":0.6039},{"x":"2022-12-08T19:00:00.000+01:00","y":0.5977},{"x":"2022-12-08T20:00:00.000+01:00","y":0.5738},{"x":"2022-12-08T21:00:00.000+01:00","y":0.4776},{"x":"2022-12-08T22:00:00.000+01:00","y":0.4481},{"x":"2022-12-08T23:00:00.000+01:00","y":0.4135}]],"labels":[]}]

```

```auto
[{"series":["Preis heute"],"data":[[{"x":"2022-12-07T00:00:00.000+01:00","y":0.3723},{"x":"2022-12-07T01:00:00.000+01:00","y":0.3379},{"x":"2022-12-07T02:00:00.000+01:00","y":0.3001},{"x":"2022-12-07T03:00:00.000+01:00","y":0.2954},{"x":"2022-12-07T04:00:00.000+01:00","y":0.3313},{"x":"2022-12-07T05:00:00.000+01:00","y":0.3661},{"x":"2022-12-07T06:00:00.000+01:00","y":0.3597},{"x":"2022-12-07T07:00:00.000+01:00","y":0.468},{"x":"2022-12-07T08:00:00.000+01:00","y":0.5135},{"x":"2022-12-07T09:00:00.000+01:00","y":0.4688},{"x":"2022-12-07T10:00:00.000+01:00","y":0.4444},{"x":"2022-12-07T11:00:00.000+01:00","y":0.4204},{"x":"2022-12-07T12:00:00.000+01:00","y":0.4107},{"x":"2022-12-07T13:00:00.000+01:00","y":0.442},{"x":"2022-12-07T14:00:00.000+01:00","y":0.543},{"x":"2022-12-07T15:00:00.000+01:00","y":0.5771},{"x":"2022-12-07T16:00:00.000+01:00","y":0.5977},{"x":"2022-12-07T17:00:00.000+01:00","y":0.5563},{"x":"2022-12-07T18:00:00.000+01:00","y":0.5334},{"x":"2022-12-07T19:00:00.000+01:00","y":0.5196},{"x":"2022-12-07T20:00:00.000+01:00","y":0.5439},{"x":"2022-12-07T21:00:00.000+01:00","y":0.4467},{"x":"2022-12-07T22:00:00.000+01:00","y":0.4153},{"x":"2022-12-07T23:00:00.000+01:00","y":0.3913}]],"labels":[]}]

```

the chart shows only "Preis heute".

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [7 December 2022 19:46 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/12 "2022-12-07T19:46:07Z")

</div>

> [@Becker](#):
>
> with Influx it´s maybe no good idea to write in future.  
> I´m writing every minute values in influx, time is = now.

No, best to do it straight away, InfluxDB can easily handle per-minute data like that. I have probably several hundred writes per minute and it barely registers.

---

<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:** [7 December 2022 20:34 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/13 "2022-12-07T20:34:29Z")

</div>

> [@Becker](#):
>
> I don´t get it in one chart:

No I must be mistaken about feeding two inputs to the chart.

I think I got it working by joining the two streams into a single message (using msg.topic), at least I do get two lines on the graph.  
I'm not completely convinced this is what you are after 😀

 ![Untitled 3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/e/7e6b2e2c733b932e94badbe9a348ffe117b0d59e.jpeg)  
 ![Untitled 4](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/e/aee63f5568e196c6083e657580a9058ef41bac6b.jpeg)

```auto
[{"id":"03ad8b401b677a22","type":"function","z":"bd9513ca4c1623c3","name":"function 25","func":"msg.payload =[{ \"total\": 0.3723, \"energy\": 0.2646, \"tax\": 0.1077, \"startsAt\": \"2022-12-07T00:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"CHEAP\" }, { \"total\": 0.3379, \"energy\": 0.2357, \"tax\": 0.1022, \"startsAt\": \"2022-12-07T01:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"CHEAP\" }, { \"total\": 0.3001, \"energy\": 0.2039, \"tax\": 0.0962, \"startsAt\": \"2022-12-07T02:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"CHEAP\" }, { \"total\": 0.2954, \"energy\": 0.2, \"tax\": 0.0954, \"startsAt\": \"2022-12-07T03:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"CHEAP\" }, { \"total\": 0.3313, \"energy\": 0.2302, \"tax\": 0.1011, \"startsAt\": \"2022-12-07T04:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"CHEAP\" }, { \"total\": 0.3661, \"energy\": 0.2594, \"tax\": 0.1067, \"startsAt\": \"2022-12-07T05:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"CHEAP\" }, { \"total\": 0.3597, \"energy\": 0.254, \"tax\": 0.1057, \"startsAt\": \"2022-12-07T06:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"CHEAP\" }, { \"total\": 0.468, \"energy\": 0.345, \"tax\": 0.123, \"startsAt\": \"2022-12-07T07:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"NORMAL\" }, { \"total\": 0.5135, \"energy\": 0.3833, \"tax\": 0.1302, \"startsAt\": \"2022-12-07T08:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"NORMAL\" }, { \"total\": 0.4688, \"energy\": 0.3457, \"tax\": 0.1231, \"startsAt\": \"2022-12-07T09:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"NORMAL\" }, { \"total\": 0.4444, \"energy\": 0.3252, \"tax\": 0.1192, \"startsAt\": \"2022-12-07T10:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"NORMAL\" }, { \"total\": 0.4204, \"energy\": 0.305, \"tax\": 0.1154, \"startsAt\": \"2022-12-07T11:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"NORMAL\" }, { \"total\": 0.4107, \"energy\": 0.2968, \"tax\": 0.1139, \"startsAt\": \"2022-12-07T12:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"CHEAP\" }, { \"total\": 0.442, \"energy\": 0.3232, \"tax\": 0.1188, \"startsAt\": \"2022-12-07T13:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"NORMAL\" }, { \"total\": 0.543, \"energy\": 0.4081, \"tax\": 0.1349, \"startsAt\": \"2022-12-07T14:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"EXPENSIVE\" }, { \"total\": 0.5771, \"energy\": 0.4367, \"tax\": 0.1404, \"startsAt\": \"2022-12-07T15:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"EXPENSIVE\" }, { \"total\": 0.5977, \"energy\": 0.4541, \"tax\": 0.1436, \"startsAt\": \"2022-12-07T16:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"EXPENSIVE\" }, { \"total\": 0.5563, \"energy\": 0.4193, \"tax\": 0.137, \"startsAt\": \"2022-12-07T17:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"EXPENSIVE\" }, { \"total\": 0.5334, \"energy\": 0.4, \"tax\": 0.1334, \"startsAt\": \"2022-12-07T18:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"NORMAL\" }, { \"total\": 0.5196, \"energy\": 0.3884, \"tax\": 0.1312, \"startsAt\": \"2022-12-07T19:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"NORMAL\" }, { \"total\": 0.5439, \"energy\": 0.4088, \"tax\": 0.1351, \"startsAt\": \"2022-12-07T20:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"EXPENSIVE\" }, { \"total\": 0.4467, \"energy\": 0.3272, \"tax\": 0.1195, \"startsAt\": \"2022-12-07T21:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"NORMAL\" }, { \"total\": 0.4153, \"energy\": 0.3007, \"tax\": 0.1146, \"startsAt\": \"2022-12-07T22:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"CHEAP\" }, { \"total\": 0.3913, \"energy\": 0.2806, \"tax\": 0.1107, \"startsAt\": \"2022-12-07T23:00:00.000+01:00\", \"currency\": \"EUR\", \"level\": \"CHEAP\" }]\nmsg.topic = \"preis\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":460,"wires":[["93985983c37acb63"]]},{"id":"0973f4cd414c4027","type":"inject","z":"bd9513ca4c1623c3","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":460,"wires":[["03ad8b401b677a22"]]},{"id":"543fa452bf64d3e7","type":"ui_chart","z":"bd9513ca4c1623c3","name":"","group":"a6e358b.672ffa8","order":1,"width":"16","height":"4","label":"Two Lines","chartType":"line","legend":"false","xformat":"dd HH:mm","interpolate":"step","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#008040","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":800,"y":480,"wires":[[]]},{"id":"be8c295de12cb9aa","type":"function","z":"bd9513ca4c1623c3","name":"function 26","func":"msg.payload = { \"forecasts\": [{ \"pv_estimate\": 0.229, \"pv_estimate10\": 0.1482, \"pv_estimate90\": 0.7065, \"period_end\": \"2022-12-07T14:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.4994, \"pv_estimate10\": 0.0886, \"pv_estimate90\": 0.9187, \"period_end\": \"2022-12-07T15:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0.0068, \"period_end\": \"2022-12-07T15:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T16:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T16:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T17:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T17:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T18:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T18:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T19:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T19:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T20:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T20:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T21:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T21:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T22:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T22:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T23:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-07T23:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T00:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T00:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T01:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T01:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T02:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T02:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T03:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T03:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T04:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T04:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T05:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T05:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T06:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T06:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T07:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T07:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.0411, \"pv_estimate10\": 0.0137, \"pv_estimate90\": 0.0795, \"period_end\": \"2022-12-08T08:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.1643, \"pv_estimate10\": 0.0411, \"pv_estimate90\": 0.4345, \"period_end\": \"2022-12-08T08:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.3213, \"pv_estimate10\": 0.0838, \"pv_estimate90\": 1.3162, \"period_end\": \"2022-12-08T09:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.5813, \"pv_estimate10\": 0.1327, \"pv_estimate90\": 2.3721, \"period_end\": \"2022-12-08T09:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.8947, \"pv_estimate10\": 0.1956, \"pv_estimate90\": 3.3218, \"period_end\": \"2022-12-08T10:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 1.1461, \"pv_estimate10\": 0.2444, \"pv_estimate90\": 4.0808, \"period_end\": \"2022-12-08T10:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 1.3128, \"pv_estimate10\": 0.2724, \"pv_estimate90\": 4.9174, \"period_end\": \"2022-12-08T11:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 1.4434, \"pv_estimate10\": 0.2933, \"pv_estimate90\": 5.3134, \"period_end\": \"2022-12-08T11:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 1.5262, \"pv_estimate10\": 0.3143, \"pv_estimate90\": 5.6234, \"period_end\": \"2022-12-08T12:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 1.4434, \"pv_estimate10\": 0.2933, \"pv_estimate90\": 5.8358, \"period_end\": \"2022-12-08T12:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 1.2099, \"pv_estimate10\": 0.2346, \"pv_estimate90\": 5.6014, \"period_end\": \"2022-12-08T13:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.8882, \"pv_estimate10\": 0.1656, \"pv_estimate90\": 5.274, \"period_end\": \"2022-12-08T13:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.5277, \"pv_estimate10\": 0.0966, \"pv_estimate90\": 4.8957, \"period_end\": \"2022-12-08T14:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.2724, \"pv_estimate10\": 0.0489, \"pv_estimate90\": 3.5171, \"period_end\": \"2022-12-08T14:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.0978, \"pv_estimate10\": 0.014, \"pv_estimate90\": 1.4934, \"period_end\": \"2022-12-08T15:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0.0071, \"period_end\": \"2022-12-08T15:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T16:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T16:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T17:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T17:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T18:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T18:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T19:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T19:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T20:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T20:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T21:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T21:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T22:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T22:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T23:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-08T23:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T00:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T00:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T01:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T01:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T02:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T02:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T03:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T03:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T04:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T04:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T05:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T05:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T06:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T06:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T07:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0, \"pv_estimate10\": 0, \"pv_estimate90\": 0, \"period_end\": \"2022-12-09T07:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.058, \"pv_estimate10\": 0.0145, \"pv_estimate90\": 0.0745, \"period_end\": \"2022-12-09T08:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.2219, \"pv_estimate10\": 0.0429, \"pv_estimate90\": 0.5086, \"period_end\": \"2022-12-09T08:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.409, \"pv_estimate10\": 0.0787, \"pv_estimate90\": 1.4126, \"period_end\": \"2022-12-09T09:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.6958, \"pv_estimate10\": 0.1202, \"pv_estimate90\": 2.4273, \"period_end\": \"2022-12-09T09:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.9855, \"pv_estimate10\": 0.1697, \"pv_estimate90\": 3.3679, \"period_end\": \"2022-12-09T10:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 1.2295, \"pv_estimate10\": 0.2165, \"pv_estimate90\": 4.2655, \"period_end\": \"2022-12-09T10:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 1.4197, \"pv_estimate10\": 0.2584, \"pv_estimate90\": 4.964, \"period_end\": \"2022-12-09T11:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 1.5262, \"pv_estimate10\": 0.2933, \"pv_estimate90\": 5.3384, \"period_end\": \"2022-12-09T11:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 1.5174, \"pv_estimate10\": 0.3036, \"pv_estimate90\": 5.5584, \"period_end\": \"2022-12-09T12:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 1.423, \"pv_estimate10\": 0.2829, \"pv_estimate90\": 5.7067, \"period_end\": \"2022-12-09T12:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 1.2337, \"pv_estimate10\": 0.2484, \"pv_estimate90\": 5.8673, \"period_end\": \"2022-12-09T13:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.9599, \"pv_estimate10\": 0.1932, \"pv_estimate90\": 5.274, \"period_end\": \"2022-12-09T13:30:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.6176, \"pv_estimate10\": 0.1257, \"pv_estimate90\": 4.918, \"period_end\": \"2022-12-09T14:00:00.0000000Z\", \"period\": \"PT30M\" }, { \"pv_estimate\": 0.3143, \"pv_estimate10\": 0.0768, \"pv_estimate90\": 3.5714, \"period_end\": \"2022-12-09T14:30:00.0000000Z\", \"period\": \"PT30M\" }] }\nmsg.topic = \"forecasts\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":500,"wires":[["93985983c37acb63"]]},{"id":"4306121bacd2a5f4","type":"inject","z":"bd9513ca4c1623c3","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":500,"wires":[["be8c295de12cb9aa"]]},{"id":"93985983c37acb63","type":"join","z":"bd9513ca4c1623c3","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":470,"y":480,"wires":[["fa12b6ef14eb3e0e"]]},{"id":"fa12b6ef14eb3e0e","type":"function","z":"bd9513ca4c1623c3","name":"Setup chart","func":"let preis = msg.payload.preis.map(e => { return { x: e.startsAt, y: e.total } }) ;\nlet forecasts = msg.payload.forecasts.forecasts.map(f => { return { x: f.period_end, y: f.pv_estimate } }) \nconst chart = [{\n \"series\": [\"Foo\"],\n \"data\": [preis, forecasts],\n \"labels\": [\"foo\"]\n}];\nmsg.payload = chart;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":630,"y":480,"wires":[["543fa452bf64d3e7"]]},{"id":"a6e358b.672ffa8","type":"ui_group","name":"Demo","tab":"4e528085.a1bfa","order":1,"disp":true,"width":"20","collapse":false},{"id":"4e528085.a1bfa","type":"ui_tab","name":"Demo","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

```

---

<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:** [21 December 2022 20:34 UTC](https://discourse.nodered.org/t/how-to-display-an-array-as-graph-chart/71808/14 "2022-12-21T20:34:56Z")

</div>

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