Hi .I want to display temperature and windspeed from open weather map api call in the chart node. Code works perfectly fine when displaying one attribute data on chart.
This is my function:
var chartdata = msg.payload;
var temp=[];
var wind=[];
var p=global.get('points');
for(var i = 0;i<=p ; i++){
temp.push({x:chartdata[i].Timestamp*1000,y:chartdata[i].Temperature});
wind.push({x:chartdata[i].Timestamp*1000,y:chartdata[i].WindSpeed});
}
var tempchart = [{
"series":["Temperature"],
"data":[temp],
"labels":[""],
}];
var windchart = [{
"series":["WindSpeed"],
"data":[wind],
"labels":[""],
}];
msg={};
msg1={};
msg.payload=tempchart;
msg.topic='Temperature';
msg1.payload=windchart;
msg1.topic='WindSpeed';
node.send([[msg,msg1]]);
But when I do so only msg1 i.e. WindSpeed graph is displayed on dashboard. Kindly help.I have attached screenshot of flow and msg object returned from chart node