You must be logged in to post your query.
Home › Forums › Report Bugs › Chart Width problem with Bootsrap Modal Popup
Tagged: Bootstrap Modal Popup issue
Hey there, I am facing chart width problem with bootstrap modal popup. I did not set any width or height, but it’s seems, chart did not get full width of modal popup. I am attaching the image. please reply asap… Bug Picture
@imi-khan,
CanvasJS Chart automatically sets the width and height of the chart according to container’s dimensions. When the container’s dimension is not specified it takes up the default width & height(500px X 400px).
You would have to set 100% width for the Chart Container.
Also, in bootstrap, since the modal is not displayed initially, chart takes the default values. To solve this issue, you can render the chart when the shown.bs.modal event is fired.
$('#chartModal').on('shown.bs.modal', function () { chart.render(); });
Please take a look at this JSFiddle.
___________ Indranil Deo Team CanvasJS
Thank you so much… work very well…
You must be logged in to reply to this topic. Login/Register