diff --git a/web/newWebsite/graph-main.js b/web/newWebsite/graph-main.js index 5b6db31..8058f94 100644 --- a/web/newWebsite/graph-main.js +++ b/web/newWebsite/graph-main.js @@ -1,8 +1,6 @@ // 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) { @@ -110,9 +108,15 @@ function createFilterContainer() { document.body.appendChild(container); } +// Function to get the link for the get request +function getLink(startDate, endDate, node) { + return link = "http://getMeasurements?dateStart=" + startDate.toISOString() + + "&dateEnd=" + endDate.toISOString() + + "&node=" + node; +} // 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-28%2011:47:11&node=113") +function fetchData(link) { + fetch(link) .then((response) => { if (!response.ok) { throw new Error("Network response was not ok");