Yii Extension for Google Visualization

I could not find any extension for Google Visualization so created a simple one. It works beautifully on my site using PieCharts but I believe I built it in a way that it will work well with the other Core Charts as well.

Simply place in your extensions folder. The rest is explained in the included comments.



I hacked this extension to make it work for AreaCharts, but am having trouble passing some of the options to it…

The chart displays fine, but when trying to add any hAxis options nothing seems to work.


  $this->Widget('ext.GoogleVisualizationAreaChartWidget', array(

        'visualization' => 'AreaChart',



			'options' => array(





					'title'=>'Share of Voice',






			'style'=>'height: 400px;',





And I get no slanted text or title on the horizontal axis.

Here is whats outputted in the view:

<script type="text/javascript">


google.load("visualization", "1", {packages:["areachart"]});


            function drawChartyw0() {

                var data = google.visualization.arrayToDataTable([["Date","Share of Voice"],["2013-06-05",31.5],["2013-05-31",34],["2013-05-28",34],["2013-05-23",39],["2013-05-23",39],["2013-05-23",39],["2013-05-20",72],["2013-05-07",64.23],["2013-05-01",18.6],["2013-05-01",16.5],["2013-04-07",16.5]]);

                var options = {"width":"800","height":"400","hAxis":{"slantedText":"true","title":"Share of Voice"},"legend":"none"};

                var chart = new google.visualization.AreaChart(document.getElementById("yw0"));

                chart.draw(data, options);




You can see the config options I’m trying to load here (scroll down to hAxis):


Any help or suggestions are appreciated!

I’ve been playing around with this all day with no luck…