From 877a718fa68af1ecc67c0e34dce9c6edf31191fc Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 27 Aug 2019 21:26:45 +0100 Subject: Add annotations for pages with confidence below 70 --- bookpipeline/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bookpipeline/main.go b/bookpipeline/main.go index 63eb6bc..c202bad 100644 --- a/bookpipeline/main.go +++ b/bookpipeline/main.go @@ -231,9 +231,13 @@ func analyse(toanalyse chan string, up chan string, errc chan error, logger *log } sort.Slice(graphconf, func(i, j int) bool { return graphconf[i].pgnum < graphconf[j].pgnum }) var xvalues, yvalues []float64 + var annotations []chart.Value2 for _, c := range graphconf { xvalues = append(xvalues, c.pgnum) yvalues = append(yvalues, c.conf) + if c.conf < 70 { + annotations = append(annotations, chart.Value2{Label: fmt.Sprintf("%.0f", c.pgnum), XValue: c.pgnum, YValue: c.conf}) + } } mainSeries := chart.ContinuousSeries{ XValues: xvalues, @@ -305,6 +309,9 @@ func analyse(toanalyse chan string, up chan string, errc chan error, logger *log maxSeries, chart.LastValueAnnotation(minSeries), chart.LastValueAnnotation(maxSeries), + chart.AnnotationSeries{ + Annotations: annotations, + }, //chart.ContinuousSeries{ // YAxis: chart.YAxisSecondary, // XValues: xvalues, -- cgit v1.2.1-24-ge1ad