plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

show/hide legend items does not work for stacked area chart

Open Beth106 opened this issue 3 years ago • 7 comments

The standard show/hide lines when you click/double click on legend items breaks under certain circumstances for stacked charts.

  • Go to https://codepen.io/plotly/pen/QEZvWJ
  • Add property "stackgroup: 'one'" to each line (I also added an extra trace)
  • Result: image
  • (Alternatively see https://codepen.io/sargonpiraev/pen/jOVzJYe)

Bug replication:

  • Double click a legend item to isolate that line
  • Single click the same legend item to hide all lines
  • Double click any legend item to reshow all lines

Expected and actual result

  • Expected: Same image as we started with above
  • Actual Result: image

Bug replication

It gets even worse if you then:

  • Single click the original legend item to hide it
  • Single click the original legend item to show it again

Expected and actual result

  • Expected: Same image as we started with above
  • Actual Result image

Beth106 avatar Mar 14 '22 18:03 Beth106

@Beth106 did you ever figure out how to deal with this?

Kieran-Lynn avatar Jul 11 '24 04:07 Kieran-Lynn

@gvwilson any update on this? saw you picked it up 2 weeks ago

Kieran-Lynn avatar Jul 11 '24 04:07 Kieran-Lynn

Hi @Kieran-Lynn - I'm now managing the Libraries team at Plotly, so I've assigned this to myself for triage and assignment, but realistically it will be months before it gets to the top of our list - we have a lot of old issues to wade through :-(

gvwilson avatar Jul 11 '24 12:07 gvwilson

No I never fixed it, I ended up just turning off the show/hide functionality for my stacked charts so it didn't confuse anyone. Would definitely be useful to get a fix as high priority.

On Thu, 11 Jul 2024, 05:10 Kieran Lynn, @.***> wrote:

@Beth106 https://github.com/Beth106 did you ever figure out how to deal with this?

— Reply to this email directly, view it on GitHub https://github.com/plotly/plotly.js/issues/6138#issuecomment-2221984503, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKCGYIE5PS555CUO5G66Z7TZLYASJAVCNFSM6AAAAABKWENEBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRRHE4DINJQGM . You are receiving this because you were mentioned.Message ID: @.***>

Beth106 avatar Jul 13 '24 15:07 Beth106

Hello, did this issue ever get fixed, as I am also seeing it 2 years later using plotly 5.24.1

bryandickman avatar Dec 21 '24 17:12 bryandickman

The issue has not been solved still. Using Plotly 6.0.1 and Dahs 3.0.0 Image from a Dash interface: Image

However, when the image is downloaded using the "download" control on the graph, the issue is not there, which could mean that the problem is coming from the display functions (?) only

Same image when downloaded Image

Any idea if a fix is planned for this issue please?

supernyv avatar Mar 22 '25 09:03 supernyv

@supernyv thanks for flagging this - it's in our backlog, but realistically it's going to be a while before we can get to it. If someone in the community can submit a PR, I can prioritize review. Thanks - @gvwilson

gvwilson avatar Mar 31 '25 14:03 gvwilson