From dfbe2ed44f34f8bdabc5ca598387d7543fb9591b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 3 Sep 2024 10:09:08 +0200 Subject: dashboard/app: add total value on Bugs/Month graph --- dashboard/app/graphs.go | 9 ++++++--- dashboard/app/templates/graph_histogram.html | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/dashboard/app/graphs.go b/dashboard/app/graphs.go index e4ded73d6..f3f62577e 100644 --- a/dashboard/app/graphs.go +++ b/dashboard/app/graphs.go @@ -73,8 +73,9 @@ type uiGraphHeader struct { } type uiGraphColumn struct { - Hint string - Vals []uiGraphValue + Hint string + Annotation float32 + Vals []uiGraphValue } type uiGraphValue struct { @@ -499,7 +500,9 @@ func createFoundBugs(c context.Context, bugs []*Bug) *uiGraph { col := uiGraphColumn{Hint: month.Format("Jan-06")} stats := months[month] for _, typ := range types { - col.Vals = append(col.Vals, uiGraphValue{Val: float32(stats[typ.name])}) + val := float32(stats[typ.name]) + col.Vals = append(col.Vals, uiGraphValue{Val: val}) + col.Annotation += val } columns = append(columns, col) } diff --git a/dashboard/app/templates/graph_histogram.html b/dashboard/app/templates/graph_histogram.html index 930d7b912..2f7a6bcc4 100644 --- a/dashboard/app/templates/graph_histogram.html +++ b/dashboard/app/templates/graph_histogram.html @@ -15,12 +15,20 @@ Number of found bugs per month. -- cgit mrf-deployment