Yii-Chartjs With Mysql

Hello everyone, i’m a newbie and just started this, i’ve been planning to use charts for my new project and i found this amazing charts extension : http://www.yiiframework.com/extension/yii-chartjs/

It works perfectly fine. But how to generate the chart using data from MySQL database. Can anyone help me.

Thanks :)

i tried to pass my y-axis data to my view and it worked fine




<h1>bar chart</h1>

<?php

$this->widget(

		'chartjs.widgets.ChBars',

		array(

				'width' => 600,

				'height' => 300,

				'htmlOptions' => array(

				

				),

				'labels' => array("January","February","March","April","May","June","July","August","September","Octeber","November","December"),

				'datasets' => array(

						array(

								"fillColor" => "#ff00ff",

								"strokeColor" => "rgba(220,220,220,1)",

		
[quote]
this data sql result query 
[/quote]
      "data" =>$data,

						)

				),

				'options' => array()

		)

);

?>