This commit is contained in:
Max 2020-10-22 13:42:30 +01:00
parent 0985d77202
commit 0d18daeb9c

View File

@ -31,8 +31,8 @@ async function get_all_data() {
function draw_graph(ySeries, names, colors, div_name) {
var trace = {
type: 'line',
y: ySeries,
type: 'bar',
y: ySeries.data,
x: formatted_datetimes,
text: names.title,
marker: { color: colors.trace, line: { width: 5 } }
@ -58,31 +58,31 @@ async function plot_graphs() {
await get_all_data()
console.log("Starting data plot...");
draw_graph(
temperatures,
{data: temperatures, type: 'line'},
{title: "Air Temperature",yaxis: "Temperature in ºC"},
{trace: '#00FFFF'},
'temp_chart'
)
draw_graph(
humidities,
{data: humidities, type: 'line'},
{title: "Humidity",yaxis: "Air humidity in %"},
{trace: '#00AAFF'},
'humidity_chart'
)
draw_graph(
winds,
{data: winds, type: 'line'},
{title: "Wind speed",yaxis: "Wind speed in m/s"},
{trace: '#AAFFAA'},
'wind_chart'
)
draw_graph(
precipitations,
{data: precipitations, type: 'bar'},
{title: "Precipitation",yaxis: "Rainfall in mm"},
{trace: '#FF3333'},
'rain_chart'
)
draw_graph(
clouds,
{data: clouds, type: 'line'},
{title: "Cloudiness",yaxis: "Cloud coverage in %"},
{trace: '#FFFFFF'},
'cloud_chart'