This commit is contained in:
Will Charczuk 2016-07-11 18:49:50 -07:00
parent 9a5138b21d
commit 693a2ab66f

View File

@ -1,6 +1,7 @@
package main package main
import ( import (
"fmt"
"log" "log"
"math/rand" "math/rand"
"net/http" "net/http"
@ -61,6 +62,20 @@ func chartHandler(rc *web.RequestContext) web.ControllerResult {
XValues: s1x, XValues: s1x,
YValues: s1y, YValues: s1y,
}, },
chart.AnnotationSeries{
Name: fmt.Sprintf("%s - Last Value", "Test"),
Style: chart.Style{
Show: true,
StrokeColor: chart.DefaultSeriesStrokeColors[0],
},
Annotations: []chart.Annotation{
chart.Annotation{
X: float64(s1x[len(s1x)-1].Unix()),
Y: s1y[len(s1y)-1],
Label: fmt.Sprintf("%s - %s", "test", chart.FloatValueFormatter(s1y[len(s1y)-1])),
},
},
},
}, },
} }