Reputation: 3531
I'm trying to use zingchart to create responsive charts, but the chart does not get sized correctly upon the initial rendering. If you resize the window, it does get sized properly though.
Steps to recreate it:
download the file from here.
Change lines 148 and 149 with:
height: "100%",
width: "100%"
Open a new browser window (tried it on latest chrome, windows), resize it to a width of 450 or less pixels.
Open the edited file in that window.
The chart will have a width of 640px, even though its parent div will be sized properly.
I've tried of course, to set the div's size manually, or to 100% width, and the html and body's width to 100%.
Am I doing something wrong, or is it the library's fault?
Upvotes: 1
Views: 468
Reputation: 3531
In order for the chart to size properly, the div containing the id, must have both height and width to 100%. If either is missing (I was ommiting height), it doesn't get sized properly.
Upvotes: 3