Yii Framework Forum: Yiiwheels + Google Visualization - Chart Size - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yiiwheels + Google Visualization - Chart Size Rate Topic: -----

#1 User is offline   Ian T. 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 23-March 12
  • Location:Stamford, CT

Posted 17 October 2013 - 10:56 PM

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!
0

#2 User is offline   Argent 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 85
  • Joined: 23-February 13
  • Location:Hungary

Posted 18 October 2013 - 03:31 AM

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
0

#3 User is offline   Ian T. 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 23-March 12
  • Location:Stamford, CT

Posted 18 October 2013 - 09:54 AM

View PostArgent, on 18 October 2013 - 03:31 AM, said:


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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users