MCPcopy Index your code
hub / github.com/gonum/plot / tickLabelWidth

Function tickLabelWidth

axis.go:714–727  ·  view source on GitHub ↗

tickLabelWidth returns the width of the widest tick mark label.

(sty text.Style, ticks []Tick)

Source from the content-addressed store, hash-verified

712
713// tickLabelWidth returns the width of the widest tick mark label.
714func tickLabelWidth(sty text.Style, ticks []Tick) vg.Length {
715 maxWidth := vg.Length(0)
716 for _, t := range ticks {
717 if t.IsMinor() {
718 continue
719 }
720 r := sty.Rectangle(t.Label)
721 w := r.Max.X - r.Min.X
722 if w > maxWidth {
723 maxWidth = w
724 }
725 }
726 return maxWidth
727}
728
729// formatFloatTick returns a g-formated string representation of v
730// to the specified precision.

Callers 3

sizeMethod · 0.85
drawMethod · 0.85
GlyphBoxesMethod · 0.85

Calls 2

IsMinorMethod · 0.80
RectangleMethod · 0.45

Tested by

no test coverage detected