can succesfully make a graph from database data
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user