19 lines
541 B
JavaScript
19 lines
541 B
JavaScript
|
console.log("bla")
|
||
|
|
||
|
var gauge = document.getElementById('temp-gauge');
|
||
|
// Randomly add a data point every 500ms
|
||
|
var random = new TimeSeries();
|
||
|
setInterval(function() {
|
||
|
var nr = Math.random() * 100;
|
||
|
random.append(new Date().getTime(), nr);
|
||
|
gauge.dataset.value = nr;
|
||
|
}, 500);
|
||
|
|
||
|
function createTimeline() {
|
||
|
var chart = new SmoothieChart();
|
||
|
chart.addTimeSeries(random, { strokeStyle: 'rgba(0, 255, 0, 1)', fillStyle: 'rgba(0, 255, 0, 0.2)', lineWidth: 4 });
|
||
|
chart.streamTo(document.getElementById("chart"), 500);
|
||
|
}
|
||
|
|
||
|
createTimeline();
|