From 9231bacd968b7053f9bfede99abcf5a880cc8e67 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Fri, 29 Nov 2024 15:22:38 -0500 Subject: server dashboard: chart axis labels --- server/chart.go | 6 ++++++ server/dashboard.html | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/chart.go b/server/chart.go index 4d7298b..8e326ca 100644 --- a/server/chart.go +++ b/server/chart.go @@ -29,14 +29,17 @@ func (h HumidityChartHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) } graph := chart.Chart{ + Title: "Humidity per Room", Background: chart.Style{ Padding: chart.Box{Top: 20, Left: 20}, }, Series: buildSortedSeries(h.building), XAxis: chart.XAxis{ + Name: "time", ValueFormatter: chart.TimeMinuteValueFormatter, }, YAxis: chart.YAxis{ + Name: "relative humidity (%)", Range: &chart.ContinuousRange{Min: minHumidity, Max: maxHumidity}, }, } @@ -69,6 +72,7 @@ func (h DutyCycleChartHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) } graph := chart.Chart{ + Title: "Duty Cycle", Background: chart.Style{ Padding: chart.Box{Top: 20, Left: 20}, }, @@ -76,9 +80,11 @@ func (h DutyCycleChartHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) chart.TimeSeries{XValues: x, YValues: y}, }, XAxis: chart.XAxis{ + Name: "time", ValueFormatter: chart.TimeMinuteValueFormatter, }, YAxis: chart.YAxis{ + Name: "duty cycle (%)", Range: &chart.ContinuousRange{Min: minDutyCycle, Max: maxDutyCycle}, }, } diff --git a/server/dashboard.html b/server/dashboard.html index cac92d1..d710eee 100644 --- a/server/dashboard.html +++ b/server/dashboard.html @@ -48,9 +48,7 @@ {{ end }}
-

Humidity per Room vs. Time

chart of humidity vs time -

Duty Cycle vs. Time

chart of duty cycle vs time -- cgit v1.2.3