-
Notifications
You must be signed in to change notification settings - Fork 4
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
Discussion: position the legend right of the dygraph #13
Comments
Putting the legend on the right is not advisable in all circumstances, e.g. on an iPhone where real estate is at a premium, most likely the user will hold the phone in landscape orientation to best see the time series and you don't want to obstruct the data with metadata. I can only see legend on the right making sense if you have a browser maximized on an obnoxiously wide 16:9 screen (I usually split my 16:10 screen in two horizontally so I have two 16:5 portrait windows side by side). So this layout should only be activated if the screen is wide enough to do so without compromising the information density. That responsive layout can be done using a media query, e.g. something like:
which means if the viewport is at least 1200px wide, divide it 2/3-1/3 into graph and legend, otherwise keep the layout. Similarly use can use |
Thanks for the suggestion. Let me know if you think it is fit for a PR. |
Hi,
i've been trying to rebuild the layout, so that the legend and the "autoupdate" form are right of the ping chart/graph.
I have two attempts; neither really makes me happy, yet.
DIsclaimer: I have not done very much in webdesign for more than 10 years. (And even before i would not have called myself a pro ;))
I'd like to hear your opinion, maybe you have a solution?
CSS Grid
This one uses CSS grid - which seems to be supported by most modern browsers.
https://github.com/aslmx/pingwatch/tree/modern_layout
It lets you resize the window, but if you make it smaller, you have to reload in order to get it properly sized (so window resize only works in one direction -> increase):
There is also flexgrid(?) which can be used for even more advanced results, but i did not yet understand it enough.
DIV
This one here is just a more structured (more divs) version, which more or less works.
https://github.com/aslmx/pingwatch/blob/webui/index.html
It is actually quite hard, as it is not known - without prior query of the db, to check the ping dests - how wide the legend should be. If you only ping "8.8.8.8" it won't take much space, but if you ping thatreallylonghostnamewhichmightexist.com, then it will not look that nice.
Others?
I've never worked with jQuery or other JS frameworks, but a very quick search suggests that these make it very easy to have a kind of "divider" where the user can dynamically size the legend "container" to fit his needs.
I'd appreciate your feedback - or solution ;-)
The text was updated successfully, but these errors were encountered: