Skip to content

Discussion: position the legend right of the dygraph #13

Description

@aslmx

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 ;-)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions