-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pie charts do not show legends on mobile browsers #2073
Comments
I can confirm that this behavior appears on an Android device as well.
|
Hey Daniel, I fee a bit sheepish here. I just noticed and have verified that the issue around the pie charts not showing the legend on mobile is when it's in portrait mode. That is, if I take out my phone, hold it as usual (portrait) and load a page with a pie chart, I get no legend. If I turn my phone to landscape, the page still shows no legend. But if I THEN reload the page (while the phone is still in landscape), it does show the legend. So stupid me. The Mermaid-js library likely loads the graph with/without legend based on the browser dimensions at the time of page load. But it doesn't change simply by reorienting the phone. You have to reload the page. 🤦♂️ I still think it'd be nice if Mermaid would do something different, like maybe put the legend below the pie chart when in small portrait mode. But that's really an issue for the Mermaid folks to deal with. |
I'm having same issue here. It seems the pie chart renders as the element width, and if that width isn't wide enough the charts still shows but been cutoff. I think it would be better if the pie chart can render more responsive or having internal minimal width to downsize the chart in order to view the whole graph. |
Still no workaround for this issue ? Indeed having the legend below the pie would be nice. |
Describe the bug
When viewing webpages with Mermaid pie charts on desktop browsers, you see the legend with labels to the right of the pie chart. When you do the same on mobile browsers, you do not, even when there is plenty of width to do so (e.g., turning your phone to landscape mode). This makes pie charts a bit useless when viewed on mobile devices, as all you see are percentages. I potentially get why in portrait mode on mobile phones, but even there pie charts remain useless without a legend. Either that or put the labels in the pie pieces with the percentages.
I experienced this with every mobile browser on my iPhone Xs, including Safari, Firefox, and Chrome. I suspect it may be the same for Android.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect to see legends to the right of the pie chart, just as I do when visiting the same page with any desktop browser.
Screenshots
Taken on my iPhone using Safari (but results are same in all mobile browsers)
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: