2amigos / yii2-chartjs-widget

ChartJs Widget For Yii2
https://2amigos.us
Other
109 stars 67 forks source link

Option height and width not working #43

Open fsnightmckngbrd opened 4 years ago

fsnightmckngbrd commented 4 years ago

Changing the values of height and width on options is not working. The chart always expands to 100%

Please help. Thanks.

farley907 commented 4 years ago

I ran into the same problem trying to set those values. While not a great answer, I worked around this by wrapping the chart in a bootstrap class, ie; <div class="col-lg-6"> <?= ChartJS::widget([]); ?></div> so that the chart would only be able to fill the container it was in.

tonydspaniard commented 4 years ago

While @farleyd response is good, you should also check on chartjs documentation: https://www.chartjs.org/docs/latest/general/responsive.html

This library is simply a wrapper of that library and it renders the js according to the configuration settings you provide.

mindochin commented 4 years ago

the width can still be adjusted. but if you limit the height to an external block, the graph goes beyond