Yiiwheels + Google Visualization - Chart Size

This has been driving me nuts…

I’ve tried everything I’ve found from all over the place.

I’m trying to make the Google PieChart Visualization fill the div and have had no success…

The current implementation is:




        $this->widget('yiiwheels.widgets.google.WhVisualizationChart', array(

             'visualization' => 'PieChart',

             'data' => $trafficByEngine, 

             'options' => array(

                'pieHole'=> '0.5'

              ),

             'htmlOptions'=>array('style'=>'width:100%; height:375px'),

        ));



and it generates a chart that fills maybe 65% of the parent div…

here is a screenshot:

Screenshot showing rendered view

I ran it through FireBug to see what was up, and the chart div fills the whole area, but the chart is still small, here is the chart div:

Screenshot showing chart div

As you can see, there is loads of white space that could be filled with the chart.

Any suggestions to fatten this chart up are very much appreciated!

Try the chartArea.width and chartArea.height:




$this->widget('yiiwheels.widgets.google.WhVisualizationChart', array(

    'visualization' => 'PieChart',

    'data' => $trafficByEngine,

    'options' => array(

        'pieHole' => '0.5',

        'chartArea' => array(

            'width' => '100%',

            'height' => '100%'

        )

    ),

    'htmlOptions' => array(

        'style' => 'width:100%; height:375px'

    )

));



Options: google-developers.appspot.com/chart/interactive/docs/gallery/piechart#Configuration_Options

Thank you Argent! That is exactly what I was looking for :)