You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve noticed a minor issue when you have a chart with a legend, that if you want to remove a particular trace then you can click either on the word in the legend or to the left of the accompanying coloured square. If you click on the coloured square itself then nothing happens, which seems counter intuitive since (when using bar charts) the square coloured box looks like a button which you’re suppose to click (and i keep finding people instinctively try to click that first to toggle on a particular trace).
I’ve attached an example where you can see that clicking on the square coloured boxes in the legend does nothing, but clicking on the word does.
For the bar chart case this seems to be because the “legendbar” element is in front of the “legendtoggle” index.
Can this behaviour be changed, because it’s causing a bit of confusion with people instinctively trying to click the coloured box first to switch off traces?
Many Thanks!
Harry
from plotly import version
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
Thank you @henrykeithturner for the reporting this issue and noticing this annoying behavior. I completely agree that clicking on the symbol should work.
You described the problem really well so I didn't have to try out your example. However, if you ever need to post an example in this repo again, we much prefer having them in a Codepen so we can run it in a browser and make sure the problem is only related to plotly.js the javascript library.
Hi all,
I initially asked about this on the plotly forum at https://community.plot.ly/t/toggle-select-for-in-legend-doesnt-work-on-color-label/20736, and so now i'm following it up here!
I’ve noticed a minor issue when you have a chart with a legend, that if you want to remove a particular trace then you can click either on the word in the legend or to the left of the accompanying coloured square. If you click on the coloured square itself then nothing happens, which seems counter intuitive since (when using bar charts) the square coloured box looks like a button which you’re suppose to click (and i keep finding people instinctively try to click that first to toggle on a particular trace).
I’ve attached an example where you can see that clicking on the square coloured boxes in the legend does nothing, but clicking on the word does.
For the bar chart case this seems to be because the “legendbar” element is in front of the “legendtoggle” index.
Can this behaviour be changed, because it’s causing a bit of confusion with people instinctively trying to click the coloured box first to switch off traces?
Many Thanks!
Harry
from plotly import version
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
trace1 = go.Bar(
x=[‘giraffes’, ‘orangutans’, ‘monkeys’],
y=[20, 14, 23],
name=‘SF Zoo’
)
trace2 = go.Bar(
x=[‘giraffes’, ‘orangutans’, ‘monkeys’],
y=[12, 18, 29],
name=‘LA Zoo’
)
data = [trace1, trace2]
layout = go.Layout(
barmode=‘group’
)
trace1 = go.Bar(
x=[‘giraffes’, ‘orangutans’, ‘monkeys’],
y=[20, 14, 23],
name=‘SF Zoo’
)
trace2 = go.Bar(
x=[‘giraffes’, ‘orangutans’, ‘monkeys’],
y=[12, 18, 29],
name=‘LA Zoo’
)
data = [trace1, trace2]
layout = go.Layout(
barmode=‘stack’
)
fig = py.graph_objs.Figure(data=data, layout=layout)
py.offline.iplot(fig)
The text was updated successfully, but these errors were encountered: