plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
16.83k stars 1.85k forks source link

Plotly Pie chart legend not work when I turn off all legend #6863

Open vtdong-tma opened 7 months ago

vtdong-tma commented 7 months ago

Hi team! I think this is a bug in Plotly. When I turn off all legends and double-click on a legend after. it seems Legend's double-click event is not working. This error only occurs on pie charts while other chart types work normally. On Plotly website: [Pie](https://plotly.com/javascript/pie-charts/)

https://github.com/plotly/plotly.js/assets/142469586/4b0532ef-e892-4a14-b3c7-779cd639f810

This function also doesn't work on my project

Expected: If turn off all legends and double-click any legend item, all legends will active Thanks

IbraheemHaseeb7 commented 7 months ago

I would like to work on this issue. @alexcjohnson I could not find anywhere that assigning an issue is necessary. If so, could you please assign me?

alexcjohnson commented 7 months ago

Thanks for checking @IbraheemHaseeb7 - no assignment necessary, you can just submit a PR when you're ready!

@DongVyThu thanks for the report, definitely a bug, and you're exactly right about the desired behavior: double-click on any hidden item and ALL items are made visible.

One more detail: double-click on a visible legend item currently behaves correctly: if any other items are visible they are hidden; if no other legend items are visible then all items are shown. The problem is only if you double-click on a hidden item, which currently does nothing regardless of the state of all the other items.