diff --git a/annotation_series.go b/annotation_series.go index 3e97d82..2ea3761 100644 --- a/annotation_series.go +++ b/annotation_series.go @@ -27,6 +27,7 @@ func (as AnnotationSeries) GetYAxis() yAxisType { func (as AnnotationSeries) annotationStyleDefaults(defaults Style) Style { return Style{ + FontColor: DefaultTextColor, Font: defaults.Font, FillColor: DefaultAnnotationFillColor, FontSize: DefaultAnnotationFontSize, diff --git a/draw.go b/draw.go index ed6039b..890fad4 100644 --- a/draw.go +++ b/draw.go @@ -165,12 +165,13 @@ func (d draw) MeasureAnnotation(r Renderer, canvasBox Box, style Style, lx, ly i // Annotation draws an anotation with a renderer. func (d draw) Annotation(r Renderer, canvasBox Box, style Style, lx, ly int, label string) { - style.WriteToRenderer(r) - + style.GetTextOptions().WriteToRenderer(r) textBox := r.MeasureText(label) textWidth := textBox.Width() halfTextHeight := textBox.Height() >> 1 + style.GetFillAndStrokeOptions().WriteToRenderer(r) + pt := style.Padding.GetTop(DefaultAnnotationPadding.Top) pl := style.Padding.GetLeft(DefaultAnnotationPadding.Left) pr := style.Padding.GetRight(DefaultAnnotationPadding.Right) @@ -200,6 +201,7 @@ func (d draw) Annotation(r Renderer, canvasBox Box, style Style, lx, ly int, lab r.Close() r.FillStroke() + style.GetTextOptions().WriteToRenderer(r) r.Text(label, textX, textY) }