color maps

This commit is contained in:
Will Charczuk 2017-04-14 17:43:52 -07:00
parent 4f15ced303
commit fdb1b191b2
11 changed files with 577 additions and 170 deletions

15
draw.go
View file

@ -56,15 +56,26 @@ func (d draw) LineSeries(r Renderer, canvasBox Box, xrange, yrange Range, style
}
if style.ShouldDrawDot() {
dotWidth := style.GetDotWidth()
defaultDotWidth := style.GetDotWidth()
style.GetDotOptions().WriteDrawingOptionsToRenderer(r)
for i := 0; i < vs.Len(); i++ {
vx, vy = vs.GetValue(i)
x = cl + xrange.Translate(vx)
y = cb - yrange.Translate(vy)
dotWidth := defaultDotWidth
if style.DotWidthProvider != nil {
dotWidth = style.DotWidthProvider(xrange.GetDelta(), yrange.GetDelta(), vx, vy)
}
if style.DotColorProvider != nil {
dotColor := style.DotColorProvider(xrange.GetDelta(), yrange.GetDelta(), vx, vy)
r.SetFillColor(dotColor)
r.SetStrokeColor(dotColor)
}
r.Circle(dotWidth, x, y)
r.FillStroke()
}