Closed Pfarrer closed 9 years ago
Hi @Pfarrer , I think I was having a similar issue like you had. I was trying to make the chart responsive. Without the height and width the chart it was showing very small. I make it work using the following setting:
'clientOptions' => [
'responsive' => true,
],
I think it is not necessary your change to the code, you can achieve the same using the responsive setting.
Cheers
Can you use that with a fixed height? If I try the responsive setting, it seems to keep a fixed width/height ratio, which is not what I want.
If you use the responsive setting. The width and height values are automatically using percentage. In example
'options' => [
"height"=>50,
"width" =>100,
],
It means 50% and 100% of the container. Resizing the browser window only resizes the chart width (at least in the tests I made).
Okay, works "good enough". It does not allow a fixed height, but the size of the chart cannot grow or shrink to strong because the responsive grid system resizes the grids before. Thanks for your help!
... to the width of the parent element before continuing with normal ChartJs operation