(width, height float64, extend bool)
| 66 | } |
| 67 | |
| 68 | func constructGraph(width, height float64, extend bool) *ui.DrawPath { |
| 69 | xs, ys := pointLocations(width, height) |
| 70 | path := ui.DrawNewPath(ui.DrawFillModeWinding) |
| 71 | |
| 72 | path.NewFigure(xs[0], ys[0]) |
| 73 | for i := 1; i < 10; i++ { |
| 74 | path.LineTo(xs[i], ys[i]) |
| 75 | } |
| 76 | |
| 77 | if extend { |
| 78 | path.LineTo(width, height) |
| 79 | path.LineTo(0, height) |
| 80 | path.CloseFigure() |
| 81 | } |
| 82 | |
| 83 | path.End() |
| 84 | return path |
| 85 | } |
| 86 | |
| 87 | func graphSize(clientWidth, clientHeight float64) (graphWidth, graphHeight float64) { |
| 88 | return clientWidth - xoffLeft - xoffRight, |
no test coverage detected