color maps
This commit is contained in:
parent
4f15ced303
commit
fdb1b191b2
11 changed files with 577 additions and 170 deletions
15
draw.go
15
draw.go
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue