Adding traces to several divs simultaneously?


I’m not sure if this is more of a html- or a plotly-related question, but:
Can you add a trace to more than one div simultaneously? I want to update several graphs on mouse click and draw the same new trace to all of them.

I could do it with a loop like this:
for (var i=0; i<myDivs.length; i++) Plotly.addTraces(myDivs[i], [{y: [2,1,2]}, {y: [4, 5, 7]}]);
but maybe there’s a more efficient way?

Again, thanks in advance!

1 Like

There’s no other way really.

1 Like