Thumbnail fulfills the plot.Thumbnailer interface.
(c *draw.Canvas)
| 20 | |
| 21 | // Thumbnail fulfills the plot.Thumbnailer interface. |
| 22 | func (et exampleThumbnailer) Thumbnail(c *draw.Canvas) { |
| 23 | pts := []vg.Point{ |
| 24 | {X: c.Min.X, Y: c.Min.Y}, |
| 25 | {X: c.Min.X, Y: c.Max.Y}, |
| 26 | {X: c.Max.X, Y: c.Max.Y}, |
| 27 | {X: c.Max.X, Y: c.Min.Y}, |
| 28 | } |
| 29 | poly := c.ClipPolygonY(pts) |
| 30 | c.FillPolygon(et.Color, poly) |
| 31 | |
| 32 | pts = append(pts, vg.Point{X: c.Min.X, Y: c.Min.Y}) |
| 33 | outline := c.ClipLinesY(pts) |
| 34 | c.StrokeLines(draw.LineStyle{ |
| 35 | Color: color.Black, |
| 36 | Width: vg.Points(1), |
| 37 | }, outline...) |
| 38 | } |
| 39 | |
| 40 | // This example creates a some standalone legends with borders around them. |
| 41 | func ExampleLegend_standalone() { |
nothing calls this directly
no test coverage detected