When calling plot on the same chart multiple times with different functions, e.g. when toggling between different graphs on the same chart, the previous displayed function persists.
This seems to happen when switching between plotting one function and two functions. The graph with one function is correctly displayed, but the one with two functions displays three graphs.
To Reproduce
if tab == 0:
var Func1 = Function.new(x, Load, "Load", {color = Color.WEB_GREEN, type = Function.Type.LINE })
chart.plot([Func1])
elif tab == 1:
var Func2 = Function.new(x, CO2, "CO2", { color = Color.RED, marker = Function.Marker.NONE, type = Function.Type.LINE })
var Func3 = Function.new(x, CO2_Concentration, "CO2 Concentration", { color = Color.BLUE, marker = Function.Marker.NONE, type = Function.Type.LINE })
chart.plot([Func2, Func3])
This code results in 3 graphs being displayed.
Expected behavior
Only the plotted functions are displayed and plot can correctly be called with different functions multiple times.
Desktop (please complete the following information):
When calling plot on the same chart multiple times with different functions, e.g. when toggling between different graphs on the same chart, the previous displayed function persists.
This seems to happen when switching between plotting one function and two functions. The graph with one function is correctly displayed, but the one with two functions displays three graphs.
To Reproduce
This code results in 3 graphs being displayed.
Expected behavior Only the plotted functions are displayed and plot can correctly be called with different functions multiple times.
Desktop (please complete the following information):