Black Lives Matter. Please consider donating to Black Girls Code today.

Disable legend click functionality (hiding traces)

Is it possible to disable traces hiding when legend elements are clicked?

Hi,

Unfortunately, this is not possible at the moment.

But we are planning on adding this feature. Please subscribe to https://github.com/plotly/plotly.js/issues/665 for the latest development info.

On another note, is it possible to just hide the mode bar/ hover tool as well as the export link at the bottom of the chart?

As of v1.37 (and specifically https://github.com/plotly/plotly.js/pull/2581) you can disable hiding traces by legend click using the plotly_legendclick event:

gd.on('plotly_legendclick',function() { return false; })
2 Likes

Is this a general convention used for Plotly events or is it only for certain ones like plotly_legendclick & plotly_legenddoubleclick?