100% width
Closed this issue · 4 comments
schmunk42 commented
How can I apply a 100% width to the chart, eg. to take the width from a surrounding bootstrap container?
tonydspaniard commented
@schmunk42 Use the options
, is the one that sets the canvas width: https://github.com/2amigos/yii2-chartjs-widget/blob/master/Chart.php#L79
schmunk42 commented
Tried it with
'options' => [
'height' => 400,
'width' => "100%"
],
but does not work at least on Safari. Width is only about 50px.
tonydspaniard commented
Will have a look
tonydspaniard commented
I know this is pretty old, but it seems the library doesn't yet support it: chartjs/Chart.js#882