MCPcopy
hub / github.com/g3n/engine / Init

Method Init

gui/chart.go:68–85  ·  view source on GitHub ↗

Init initializes a new chart with the specified width and height It is normally used to initialize a Chart embedded in a struct

(width float32, height float32)

Source from the content-addressed store, hash-verified

66// Init initializes a new chart with the specified width and height
67// It is normally used to initialize a Chart embedded in a struct
68func (ch *Chart) Init(width float32, height float32) {
69
70 ch.Panel.Initialize(ch, width, height)
71 ch.left = 40
72 ch.bottom = 20
73 ch.top = 10
74 ch.firstX = 0
75 ch.stepX = 1
76 ch.countStepX = 1
77 ch.minY = -10.0
78 ch.maxY = 10.0
79 ch.autoY = false
80 ch.formatX = "%v"
81 ch.formatY = "%v"
82 ch.fontSizeX = 14
83 ch.fontSizeY = 14
84 ch.Subscribe(OnResize, ch.onResize)
85}
86
87// SetTitle sets the chart title text and font size.
88// To remove the title pass an empty string

Callers 7

NewChartFunction · 0.45
newChartScaleXFunction · 0.45
newChartScaleYFunction · 0.45
newGraphFunction · 0.45
InitMethod · 0.45
InitializeMethod · 0.45
InitializeGraphicMethod · 0.45

Calls 2

SubscribeMethod · 0.65
InitializeMethod · 0.45

Tested by

no test coverage detected