MCPcopy Index your code
hub / github.com/g3n/engine / RemoveGraph

Method RemoveGraph

gui/chart.go:307–323  ·  view source on GitHub ↗

RemoveGraph removes and disposes of the specified graph from the chart

(g *Graph)

Source from the content-addressed store, hash-verified

305
306// RemoveGraph removes and disposes of the specified graph from the chart
307func (ch *Chart) RemoveGraph(g *Graph) {
308
309 ch.Remove(g)
310 g.Dispose()
311 for pos, current := range ch.graphs {
312 if current == g {
313 copy(ch.graphs[pos:], ch.graphs[pos+1:])
314 ch.graphs[len(ch.graphs)-1] = nil
315 ch.graphs = ch.graphs[:len(ch.graphs)-1]
316 break
317 }
318 }
319 if !ch.autoY {
320 return
321 }
322 ch.updateGraphs()
323}
324
325// updateLabelsX updates the X scale labels text
326func (ch *Chart) updateLabelsX() {

Callers

nothing calls this directly

Calls 3

updateGraphsMethod · 0.95
DisposeMethod · 0.65
RemoveMethod · 0.45

Tested by

no test coverage detected