Hacker News new | ask | show | jobs
by mbostock 5268 days ago
The aspect ratio is also problematic with taller windows; best practice is to bank to 45ยบ:

http://vis.berkeley.edu/papers/banking/

It's hard to pick the right aspect ratio without knowing the data beforehand, but you could make some reasonable assumptions about how spiky the peaks are. Given those assumptions, you could choose a fixed-height (say, 400px), and then adjust the visible time range if you still want variable-width. This would allow the chart to increase in size without compromising the aspect ratio.

Alternatively, you could use a responsive layout and just choose between two or three fixed sizes.

1 comments

Thanks for the suggestions - it's certainly an issue we're thinking about and looking to improve.

Also, d3.js is a pleasure to work with. Really appreciate all the work you've put into it.