# Injecting data & timestamp into chart

**URL:** <https://discourse.nodered.org/t/injecting-data-timestamp-into-chart/18164>\
**Category:** General\
**Created:** [19 November 2019 19:50 UTC](https://discourse.nodered.org/t/injecting-data-timestamp-into-chart/18164 "2019-11-19T19:50:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![forrest.gates](https://avatars.discourse-cdn.com/v4/letter/f/c77e96/32.png) [@forrest.gates](https://discourse.nodered.org/u/forrest.gates)\
**Post date:** [19 November 2019 19:50 UTC](https://discourse.nodered.org/t/injecting-data-timestamp-into-chart/18164/1 "2019-11-19T19:50:52Z")

</div>

Hi there, I am attempting to inject a set a data that i received from my WatsonIoT Device and putting it into a continuing chart for display. To make it easier for a test run, I chopped off all but one specific set of data, as follows:

[{"V":2,"T":1573853970884,"Q":0},{"V":21,"T":1573853971900,"Q":0},{"V":94,"T":1573853972915,"Q":0},{"V":64,"T":1573853973930,"Q":0},  
...and so forth.

What i am hoping to do is to chop off the Q value, then inject both the value and the timestamp correctly into a chart, since it is coming in from the IoT Device in chunks.

The issue I am having is that i cannot seem to put this data into the chart. I can split the data to get the value only presented, but I'm not sure how to present it together with the timestamp.

Is there a way to properly manipulate the data so it can fit perfectly within a chart when it runs?

---

<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:** [19 November 2019 21:16 UTC](https://discourse.nodered.org/t/injecting-data-timestamp-into-chart/18164/2 "2019-11-19T21:16:00Z")

</div>

If you are receiving the data in chunks, you will need to send every element from that incoming array separately.

```auto
var chartdata = msg.payload

for(var i = 0;i<chartdata.length ; i++){
    msg = {payload:chartdata[i].V, timestamp:chartdata[i].T};
    node.send(msg);
}

```

And as Q is not needed, it is ignored.

Read more: [https://github.com/node-red/node-red-dashboard/blob/master/Charts.md](https://github.com/node-red/node-red-dashboard/blob/master/Charts.md)
