Thumbnail draws a rectangle in the given style of the histogram.
(c *draw.Canvas)
| 156 | |
| 157 | // Thumbnail draws a rectangle in the given style of the histogram. |
| 158 | func (h *Histogram) Thumbnail(c *draw.Canvas) { |
| 159 | ymin := c.Min.Y |
| 160 | ymax := c.Max.Y |
| 161 | xmin := c.Min.X |
| 162 | xmax := c.Max.X |
| 163 | |
| 164 | pts := []vg.Point{ |
| 165 | {X: xmin, Y: ymin}, |
| 166 | {X: xmax, Y: ymin}, |
| 167 | {X: xmax, Y: ymax}, |
| 168 | {X: xmin, Y: ymax}, |
| 169 | } |
| 170 | if h.FillColor != nil { |
| 171 | c.FillPolygon(h.FillColor, c.ClipPolygonXY(pts)) |
| 172 | } |
| 173 | pts = append(pts, vg.Point{X: xmin, Y: ymin}) |
| 174 | c.StrokeLines(h.LineStyle, c.ClipLinesXY(pts)...) |
| 175 | } |
| 176 | |
| 177 | // binPoints returns a slice containing the |
| 178 | // given number of bins, and the width of |
nothing calls this directly
no test coverage detected