feat: support dots render function

This commit is contained in:
vicanso 2022-05-31 20:25:14 +08:00
parent 7e4de64a0d
commit 8314a2cb37
3 changed files with 393 additions and 46 deletions

View file

@ -124,6 +124,7 @@ func PainterThemeOption(theme ColorPalette) PainterOption {
}
}
// PainterWidthHeightOption set width or height of draw painter
func PainterWidthHeightOption(width, height int) PainterOption {
return func(p *Painter) {
if width > 0 {
@ -678,3 +679,11 @@ func (p *Painter) Grid(opt GridOption) *Painter {
}
return p
}
func (p *Painter) Dots(points []Point) *Painter {
for _, item := range points {
p.Circle(5, item.X, item.Y)
}
p.FillStroke()
return p
}