# Shred Payload and make a graph

**URL:** <https://discourse.nodered.org/t/shred-payload-and-make-a-graph/44308>\
**Category:** Dashboard\
**Created:** [17 April 2021 05:04 UTC](https://discourse.nodered.org/t/shred-payload-and-make-a-graph/44308 "2021-04-17T05:04:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [17 April 2021 05:04 UTC](https://discourse.nodered.org/t/shred-payload-and-make-a-graph/44308/1 "2021-04-17T05:04:44Z")

</div>

How can I extract the subheadings in the message and make a graphic? The sub message I want to create a graphic is in the visual.

 ![Ekran Alıntısı](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/2/72ea97c388a1a32f5df57f38d356df04e74e714f.jpeg)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 April 2021 06:36 UTC](https://discourse.nodered.org/t/shred-payload-and-make-a-graph/44308/2 "2021-04-17T06:36:43Z")

</div>

What sort of graphic so you want? If you mean a line graph then the help text for the dashboard chart has a link to how to fill the chart with historical data.

---

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [17 April 2021 06:53 UTC](https://discourse.nodered.org/t/shred-payload-and-make-a-graph/44308/3 "2021-04-17T06:53:35Z")

</div>

Yes line chart. But shouldn't it be necessary to extract other information from the incoming message?

---

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [17 April 2021 07:06 UTC](https://discourse.nodered.org/t/shred-payload-and-make-a-graph/44308/4 "2021-04-17T07:06:32Z")

</div>

![Ekran Alıntısı](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/d/ad86fa3d9356bc5e9ee55faa2578a5c4ea5744ec.jpeg)

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [17 April 2021 07:07 UTC](https://discourse.nodered.org/t/shred-payload-and-make-a-graph/44308/5 "2021-04-17T07:07:47Z")

</div>

Hello,  
did you read the documentation? In the part about working with messages it tells you how to change and move message properties and it helps you understand message structures:

[https://nodered.org/docs/user-guide/messages](https://nodered.org/docs/user-guide/messages)

Johannes

---

<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:** [17 April 2021 07:11 UTC](https://discourse.nodered.org/t/shred-payload-and-make-a-graph/44308/6 "2021-04-17T07:11:42Z")

</div>

In the UI chart built in help is a link to documentation that explains the required format for displaying data on the chart. Have you seen/read this?

---

<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:** [17 April 2021 07:14 UTC](https://discourse.nodered.org/t/shred-payload-and-make-a-graph/44308/7 "2021-04-17T07:14:40Z")

</div>

Here is a solution that works for most arrays of objects...

> [@Dynamic series identification from message, send data to Chart](https://discourse.nodered.org/t/dynamic-series-identification-from-message-send-data-to-chart/36682/5):
>
> So, i am not 100% certain what you are after but if (by the title "dynamic series") you mean sending alternative types of data from a database (i.e. varying fields and varying quantities) then this should get you close. It was a simple adaption of the previous solution I pointed you to, modified to build the series from the field names of the 1st data element in the data passed in. There are 2 injects to simulate two different sets of mySQL data [image] [{"id":"227e8b13.87c804…

With very little changes, you could adapt this.

---

<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:** [17 April 2021 07:46 UTC](https://discourse.nodered.org/t/shred-payload-and-make-a-graph/44308/8 "2021-04-17T07:46:53Z")

</div>

For this simple use case I would just split the array and then reformat each point into a value and timestamp and send as if they were dynamic data..

eg

```auto
[{"id":"827f6e64.6e8d4","type":"inject","z":"847a21f.bae23e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"sicaklik\":24,\"tarih\":\"2021-04-16T15:55:22.1532\"},{\"sicaklik\":23,\"tarih\":\"2021-04-16T16:05:22.1532\"}]","payloadType":"json","x":130,"y":1060,"wires":[["a746c796.79d758"]]},{"id":"a746c796.79d758","type":"split","z":"847a21f.bae23e","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":270,"y":1060,"wires":[["26f7ecdc.a15c14"]]},{"id":"48dd2222.cb7e8c","type":"ui_chart","z":"847a21f.bae23e","name":"","group":"76c7ecce.17e474","order":0,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":630,"y":1060,"wires":[[]]},{"id":"26f7ecdc.a15c14","type":"change","z":"847a21f.bae23e","name":"","rules":[{"t":"move","p":"payload.tarih","pt":"msg","to":"timestamp","tot":"msg"},{"t":"move","p":"payload.sicaklik","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":1060,"wires":[["48dd2222.cb7e8c"]]},{"id":"76c7ecce.17e474","type":"ui_group","name":"Default","tab":"1dd0150e.a0583b","order":1,"disp":true,"width":"6","collapse":false},{"id":"1dd0150e.a0583b","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/4/4403ecc2d5fd48394af3d74a6d9debf57125c39b.png)

---

<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:** [17 April 2021 07:49 UTC](https://discourse.nodered.org/t/shred-payload-and-make-a-graph/44308/9 "2021-04-17T07:49:29Z")

</div>

The beauty of node-red 👏

---

<div class="post-metadata">

**Author:** ![sefaguntepe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sefaguntepe/32/94497_2.png) [@sefaguntepe](https://discourse.nodered.org/u/sefaguntepe)\
**Post date:** [17 April 2021 08:58 UTC](https://discourse.nodered.org/t/shred-payload-and-make-a-graph/44308/10 "2021-04-17T08:58:43Z")

</div>

Thank you for a quick solution.

---

<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:** [1 May 2021 08:59 UTC](https://discourse.nodered.org/t/shred-payload-and-make-a-graph/44308/11 "2021-05-01T08:59:20Z")

</div>

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