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
Resize chart height on parent div resize #1450
Comments
Indeed. The chart can shrink, but once it's shrunk it won't expand again (because of max-height). Once the chart has shrunk it doesn't work to call resize() or flush() either. Workaround:
|
👍 |
That's timely, I have the same issue this very morning! One extra quirk is that onresize only gets called when the browser window resizes, if it's just a parent div resizing you have to work your own listener/response in somehow |
Yes, that's an issue I've also run into now. My charts are contained by divs that may resize even if the browser window doesn't resize. Apparently DOM elements don't fire the resize event. So, the only way to work around that at the moment is to have your own listener. I haven't tested that yet, but I imagine .resize on the chart should work for that once you have your own listener. |
I commented out the line (now 881 in the latest version) and vertical expansion now works. However, I am unsure if there will be any hidden problems with this. $$.selectChart.style('max-height', $$.currentHeight + "px"); |
We worked around the issue by clearing the
Alternatively, you could clear
In #842 @masayuki0812 mentioned
But I haven't noticed any issues yet with the above changes and |
I just forked and removed line 880 to get around this because the hack wouldn't help me. Who knows. Why doesn't someone fix this? There are several other issues opened around it. Or maybe I'm missing something… it's only a line! |
…ction on chart resize. See also c3js/c3#1450 (comment)
I'm still seeing this problem in 0.7.15 |
I'm having this same resize issue, but I'm not sure where you're getting the
|
When resizing the div where the chart is created, the chart automatically resizes horizontally, but not vertically because of this line:
Line 880
Please consider changing this in order to support full resize
The text was updated successfully, but these errors were encountered: