Struggling with syntax and in need of assistance. I have a basic data set that I want to display as a timeline with two filled lines (Time Series with Rangeslider).
This is the format of my data set:
[{"pm10": 12.1, "pm25": 7.0, "time": "13.08.2018 12:25:09"}, {"pm25": 6.6, "pm10": 11.1, "time": "13.08.2018 12:30:49"}, {"pm10": 12.6, "pm25": 6.2, "time": "13.08.2018 16:59:06"}, {"pm10": 9.2, "pm25": 5.8, "time": "13.08.2018 19:37:01"}, {"pm25": 5.1, "pm10": 8.7, "time": "13.08.2018 19:42:46"}, {"pm10": 7.3, "pm25": 5.5, "time": "13.08.2018 21:42:23"}, {"pm25": 5.1, "pm10": 7.1, "time": "13.08.2018 21:47:56"}, {"pm10": 8.3, "pm25": 5.5, "time": "13.08.2018 21:53:28"}]
I have tried various methods to structure the JSON for proper output but am struggling with:
- retrieving real-time data (on loading) from an external .JSON file
- organizing the array so Plotly can present the two lines (pm25 and pm10)
I've dedicated three days to this without success, any guidance would be greatly appreciated.
So far, I have attempted the solutions provided by others and reached this point: https://jsfiddle.net/v15wmeuL/2/