diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2024-11-29 15:22:38 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2024-11-29 15:22:38 -0500 |
| commit | 9231bacd968b7053f9bfede99abcf5a880cc8e67 (patch) | |
| tree | c16919ef4ab2ed2e00f53f3a8876b971e9f944ac /server | |
| parent | cee1d301809ec0b517962816b1b232c22a41eb3b (diff) | |
| download | soen422-9231bacd968b7053f9bfede99abcf5a880cc8e67.zip | |
server dashboard: chart axis labels
Diffstat (limited to 'server')
| -rw-r--r-- | server/chart.go | 6 | ||||
| -rw-r--r-- | 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 }} </table> <hr/> - <h4 class="center">Humidity per Room vs. Time</h4> <img src="/humidity_chart.png" alt="chart of humidity vs time" class="center"/> - <h4 class="center">Duty Cycle vs. Time</h4> <img src="/duty_cycle_chart.png" alt="chart of duty cycle vs time" class="center"/> </body> </html> |