var ctx = document.getElementById("accuracy").getContext('2d'); var barChart = new Chart(ctx, { type: 'horizontalBar', data: { labels: ["Horizontal Acc.", "Vertical Acc."], datasets: [{ label: 'Ublox', data: [0, 0], backgroundColor: "rgba(214, 69, 65, 1)" }, { label: 'Smartphone', data: [0, 0], backgroundColor: "rgba(30, 139, 195, 1)" }] }, options: { scales: { xAxes: [{ ticks: { min: 0, max: 10 } }] }, legend: { display: true, enabled: true }, tooltips: { enabled: false, display: false } } }); function addSerialAccuracy(hacc, vacc){ barChart.data.datasets[0].data = [hacc, vacc]; barChart.update(); } function addTCPAccuracy(hacc, vacc){ barChart.data.datasets[1].data = [hacc, vacc]; barChart.update(); } //Farbe der Lampen ändern // AN: document.getElementById("greenlamp").style.backgroundColor = 'rgba(0, 230, 64, 1)' // AUS: document.getElementById("greenlamp").style.backgroundColor = 'rgba(0, 100, 0, 1)' // AN: document.getElementById("redlamp").style.backgroundColor = 'rgba(242, 38, 19, 1)' // AUS: document.getElementById("redlamp").style.backgroundColor = 'rgba(139, 0, 0, 1)'