diff --git a/charts.go b/charts.go index fa497a7..48ef52e 100644 --- a/charts.go +++ b/charts.go @@ -49,7 +49,7 @@ func (a *App) renderChart(w http.ResponseWriter, c renderableChart) error { return nil } -func makeHistoryChart(showLegend bool, points []ServerPoint) chart.Chart { +func makeHistoryChart(points []ServerPoint, showLegend bool) chart.Chart { // TODO BUG: one day is missing randomly (usually the 3rd day in the range) in the chart var xVals []time.Time var yVals []float64 @@ -98,7 +98,6 @@ func makeHistoryChart(showLegend bool, points []ServerPoint) chart.Chart { }, } if showLegend { - // Add a legend c.Elements = []chart.Renderable{ chart.LegendThin(&c), } diff --git a/handlers.go b/handlers.go index ad7f10e..1b3df66 100644 --- a/handlers.go +++ b/handlers.go @@ -71,7 +71,7 @@ func (a *App) pageDailyChart(w http.ResponseWriter, r *http.Request, vars handle } } - c := makeHistoryChart(true, points) + c := makeHistoryChart(points, true) return a.renderChart(w, c) } @@ -88,7 +88,7 @@ func (a *App) pageWeeklyChart(w http.ResponseWriter, r *http.Request, vars handl } } - c := makeHistoryChart(false, points) + c := makeHistoryChart(points, false) return a.renderChart(w, c) }