feat: support customization of dot fill color, #181

This commit is contained in:
vicanso 2021-12-12 10:30:12 +08:00
parent c1468e8ae4
commit 5bb1a1f0bc

View file

@ -52,8 +52,9 @@ type Style struct {
StrokeColor drawing.Color StrokeColor drawing.Color
StrokeDashArray []float64 StrokeDashArray []float64
DotColor drawing.Color DotColor drawing.Color
DotWidth float64 DotFillColor drawing.Color
DotWidth float64
DotWidthProvider SizeProvider DotWidthProvider SizeProvider
DotColorProvider DotColorProvider DotColorProvider DotColorProvider
@ -429,10 +430,14 @@ func (s Style) GetFillOptions() Style {
// GetDotOptions returns the dot components. // GetDotOptions returns the dot components.
func (s Style) GetDotOptions() Style { func (s Style) GetDotOptions() Style {
fillColor := s.DotColor
if !s.DotFillColor.IsZero() {
fillColor = s.DotFillColor
}
return Style{ return Style{
ClassName: s.ClassName, ClassName: s.ClassName,
StrokeDashArray: nil, StrokeDashArray: nil,
FillColor: s.DotColor, FillColor: fillColor,
StrokeColor: s.DotColor, StrokeColor: s.DotColor,
StrokeWidth: 1.0, StrokeWidth: 1.0,
} }