can succesfully make a graph from database data

This commit is contained in:
sietse jonker
2024-04-01 11:33:18 +02:00
parent 76532c538b
commit 5e2daa445a
2 changed files with 17 additions and 28 deletions

View File

@@ -1,6 +1,9 @@
// Sample data - you can replace this with your actual dataset
const data = [];
processor = new DataProcessor();
dateStart='2024-03-27%2011:47:11'
dateEnd="2024-03-27%2011:47:11"
// Function to create checkbox with label
function createCheckBox(id, label) {
const checkbox = document.createElement("input");
@@ -109,7 +112,7 @@ function createFilterContainer() {
// Get request to fetch data from the server
function fetchData() {
fetch("http://145.92.8.114/getMeasurements?dateStart=2024-03-27%2011:47:11&dateEnd=2024-03-27%2011:47:11")
fetch("http://145.92.8.114/getMeasurements?dateStart=2024-03-27%2011:47:11&dateEnd=2024-03-28%2011:47:11")
.then((response) => {
if (!response.ok) {
throw new Error("Network response was not ok");
@@ -120,7 +123,7 @@ function fetchData() {
createFilterContainer();
processor.update(data);
processor.makeGraph();
processor.updateGraph();
processor.updateGraph(dateStart, dateEnd);
})
.catch((error) => {
console.error("Error fetching data:", error);