Code: Select all
Highcharts.getJSON(`${http}://${url}/graphs/sites/${site_id}/minute_heating_status`, function (data) {
Highcharts.stockChart(‘heating-graph-minute’, {
rangeSelector: {
selected: 1,
buttons: [{
type: ‘hour’,
count: 1,
text: ‘1h’,
dataGrouping: {
forced: true,
units: [
[‘minute’, [1]]
]
}
},
{
type: ‘day’,
count: 1,
text: ‘1d’,
dataGrouping: {
forced: true,
units: [
[‘minute’, [1]]
]
}
}
]
},
series: series_data(data),
yAxis: {
opposite: false,
title: {
text: “Temperature (°F)”
}
},
xAxis: {
title: {
text: “Timestamp”
}
},
navigator: {
maskFill: “rgba(0, 102, 0, 0.1)”
},
legend: {
enabled: true
},
credits: {
enabled: false
},
chart: {
alignTicks: false
},
tooltip: {
pointFormat: “{point.y:.2f}”
},
title: {
text: “Real Time Heating Data”,
style: {
color: ‘#000000’,
fontWeight: ‘bold’,
fontSize: ‘24px’
}
},
plotOptions: {
series: {
showInNavigator: true
}
}
});
});
11:54
Highcharts.setOptions({
global: {
useUTC: false
},
lang: {
thousandsSep: ‘,’
}
});
function series_data(data) {
var series = [];
for (var i = 0; i < data.length; i++) {
series.push({
name: data[i].name,
color: data[i].color,
data: data[i].data
});
}
return series;
};
var site_id = document.getElementById(‘site_id’).value;
var url;
var http;
It seems like the data is loading fine, but isn't appearing on the chart. Any ideas what could be the problem?