-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalysis.go
More file actions
51 lines (41 loc) · 1.12 KB
/
analysis.go
File metadata and controls
51 lines (41 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package main
import (
"FlightControl/Graph"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"gonum.org/v1/plot/plotter"
"image/color"
)
func analysisTab() fyne.CanvasObject {
graph1 := Graph.NewGraphWidget().
AddTool(Graph.NewResetAxisTool()).
AddTool(Graph.NewZoomTool()).
AddTool(Graph.NewDragTool()).
SetMaxBounds(0, 2, 0, 2)
l, _ := plotter.NewLine(plotter.XYs{{0, 0}, {1, 1}, {2, 2}})
l.Color = color.RGBA{G: 255}
graph1.Plot.Add(l)
grid := plotter.NewGrid()
graph1.Plot.Add(grid)
graph2 := Graph.NewGraphWidget().
AddTool(Graph.NewResetAxisTool()).
AddTool(Graph.NewZoomTool()).
AddTool(Graph.NewDragTool()).
SetMaxBounds(0, 2, 0, 2)
l2, _ := plotter.NewLine(plotter.XYs{{0, 0}, {1, 1}, {2, 2}})
l2.Color = color.RGBA{R: 255}
graph2.Plot.Add(l2)
r1, _ := plotter.NewScatter(plotter.XYs{{0, 0}, {1, 2}, {2, 2}})
r1.GlyphStyle.Color = color.RGBA{G: 255}
graph2.Plot.Add(r1)
grid2 := plotter.NewGrid()
graph2.Plot.Add(grid2)
graph1.SetMinWidgetSize(fyne.NewSize(10, 300))
graph2.SetMinWidgetSize(fyne.NewSize(10, 300))
return container.NewVScroll(
container.NewVBox(
graph1,
graph2,
),
)
}