Page 1 of 1

Hide and Show Graphs using Interface

Posted: 16 Aug 2022, 10:41
by cleu892
Hello,

I am wondering if it possible to toggle the visibility of the actual graph (not the little axes and grid that shows up, but the actual graph with the x and y axis and curves) using a function similar to sim.setObjectInt32Param?

To give some context, I have a user interface that asks a user which test room they'd like to start in. Different test rooms require different graph outputs, so I am looking for a way to implement this hiding and showing of specific graphs within a child script.

Cheers!

Re: Hide and Show Graphs using Interface

Posted: 17 Aug 2022, 14:46
by coppelia
Instead of hiding and showing a specific graph window, it would probably be more elegant to simply use one single graph, and reinitialize it with a different content. You'd first remove all streams/curves with sim.destroyGraphCurve(graphHandle,-1).

If you really want to show/hide the graph windows, then you'll have to modify the source in lua/graph_customization.lua, or better, copy that source into the customization script attached to the graph, and modify it there. But that is more complicated (search for createOrRemovePlotIfNeeded in that code)

Cheers

Re: Hide and Show Graphs using Interface

Posted: 18 Aug 2022, 03:40
by cleu892
Oh I see, thank you!