Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
v0.6.11 introduced vertical chart growth every time the window loses and regains focus #2567
Timeseries line charts seemed to work fine with c3 v0.6.10 and lower. Once I changed to using v0.6.11 or v0.6.12 (latest at time of writing), the chart's height grows every time the browser/page loses and regains focus.
Here's the most minimal version of a chart that does it: https://codepen.io/anon/pen/JxjdXX
When it loads, click the white rendered HTML area that contains the chart, then click back to the JS, then back to the rendered area, and so on, and so on. Each time the focus is back on the area with the chart, the chart grows vertically.
This seems to be the likely culprit: #2541
Please let me know if I can provide any further information.
You can edit settings to change to 0.6.10 to see how it used to react: https://codepen.io/rompelstompel/pen/Qoygje
Found a workaround. If you set svg's display property to block, then it seems fixing the issue.
(I'm not sure the root cause of this behavior. Sometimes svg and its wrapper div have different sizes. And that cause this bug. But in some cases (for example this one in /htdocs) it doesn't simply happen (in that case, svg and its wrapper div have the same height.)