mardi 27 juillet 2021

Convert a JSON file to an array in javascript to visualize the data in ChartsJS

I have a JSON file with a lot of temperatur data meassured every quarter hour and saved into a object in the file.

{"Temp_12:0": "26",
"Temp_12:15": "20",
"Temp_12:30": "25",
"Temp_12:45": "25",
"Temp_13:0": "26",
"Temp_13:15": "25",
"Temp_13:30": "26",
"Temp_13:45": "26"}

This is how the data is structurised in the file. I want to display the display the data on a webserver in my local network with ChartsJS. The Problem is that I don't have an idea of how to parse the data so that I can display it.

I want to parse the JSON Objects into an 1D array so it would be easy for me to visualise them.

I would be hapy if anyone here can help me with my problem because I'am relatively new to JavaScript.




Aucun commentaire:

Enregistrer un commentaire