Plot implements the Plotter interface, drawing labels.
(c draw.Canvas, p *plot.Plot)
| 73 | |
| 74 | // Plot implements the Plotter interface, drawing labels. |
| 75 | func (l *Labels) Plot(c draw.Canvas, p *plot.Plot) { |
| 76 | trX, trY := p.Transforms(&c) |
| 77 | for i, label := range l.Labels { |
| 78 | pt := vg.Point{X: trX(l.XYs[i].X), Y: trY(l.XYs[i].Y)} |
| 79 | if !c.Contains(pt) { |
| 80 | continue |
| 81 | } |
| 82 | pt = pt.Add(l.Offset) |
| 83 | c.FillText(l.TextStyle[i], pt, label) |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | // DataRange returns the minimum and maximum X and Y values |
| 88 | func (l *Labels) DataRange() (xmin, xmax, ymin, ymax float64) { |
nothing calls this directly
no test coverage detected