tweaks to fix annotation series drawing.

This commit is contained in:
Will Charczuk 2016-07-18 11:53:29 -07:00
parent 01992b9afb
commit c14ab6a4b2
2 changed files with 7 additions and 1 deletions

View file

@ -118,10 +118,11 @@ func (c Chart) Render(rp RendererProvider, w io.Writer) error {
}
c.drawCanvas(r, canvasBox)
c.drawAxes(r, canvasBox, xr, yr, yra, xt, yt, yta)
for index, series := range c.Series {
c.drawSeries(r, canvasBox, xr, yr, yra, series, index)
}
c.drawAxes(r, canvasBox, xr, yr, yra, xt, yt, yta)
c.drawTitle(r)
for _, a := range c.Elements {

View file

@ -26,6 +26,11 @@ func drawChart(res http.ResponseWriter, req *http.Request) {
},
Series: []chart.Series{
chart.ContinuousSeries{
Style: chart.Style{
Show: true,
StrokeColor: chart.GetDefaultSeriesStrokeColor(0).WithAlpha(64),
FillColor: chart.GetDefaultSeriesStrokeColor(0).WithAlpha(64),
},
XValues: []float64{1.0, 2.0, 3.0, 4.0, 5.0},
YValues: []float64{1.0, 2.0, 3.0, 4.0, 5.0},
},