Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var chart = new Chart(ctx, {
- type: 'line',
- data: {
- labels: [],
- datasets: [{
- label: "Swiatlo",
- borderColor: "#FF5733",
- data: [],
- fill: false,
- pointStyle: 'circle',
- backgroundColor: '#3498DB',
- }]
- },
- options: {}
- });
- socket.on('temp', function(data) {
- console.log(data.temp);
- chart.data.datasets.forEach((dataset) => {
- dataset.data.push(data.temp);
- });
- chart.update();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement