I use JQuery toggle() or slideToggle() functions inside an extended BaseSplunkView class.
Ths script works for panels that do not relate to SVG dashboard elements. For example it works for Single Value or HTML panels, but it does not work for chart panels.
The problem looks obvious:
When I call toggle() again in case of a click event, the panel shows up, but it is empty.
When I resize the panel (or browser window) a little bit, the chart shows up immediately. That means the SVG elements are now here, but initially painted on an invisible HTML element.