MCPcopy Create free account
hub / github.com/andlabs/ui / constructGraph

Function constructGraph

examples/histogram.go:68–85  ·  view source on GitHub ↗
(width, height float64, extend bool)

Source from the content-addressed store, hash-verified

66}
67
68func 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
87func graphSize(clientWidth, clientHeight float64) (graphWidth, graphHeight float64) {
88 return clientWidth - xoffLeft - xoffRight,

Callers 1

DrawMethod · 0.85

Calls 5

pointLocationsFunction · 0.85
NewFigureMethod · 0.80
LineToMethod · 0.80
CloseFigureMethod · 0.80
EndMethod · 0.80

Tested by

no test coverage detected