Yii Framework Forum: highchart from CGridview/Database - Yii Framework Forum

Jump to content

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

highchart from CGridview/Database Rate Topic: -----

#1 User is offline   koukiya 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 27
  • Joined: 19-August 11

Posted 26 August 2011 - 06:43 AM

Hi,
i'm using highchart extension and i want to draw a chart using data from my Cgridview, can anyone help me to do it please

here is my CGridview


$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'utilisateur-grid',
	'dataProvider'=>$model->get_nb_sent(),
	'filter'=>$model,
	'columns'=>array(
		'loginu',
		'nbr',
		'clicks',
		'pr',
	
	),
)); 


and this is an example of a chart,

<?php
 $this->widget('application.extensions.highcharts.HighchartsWidget', array(
   'options'=>array(
     'chart'=> array('defaultSeriesType'=>'column',),
      'title' => array('text' => 'TITLE'),
      'legend'=>array('enabled'=>false),
      'xAxis'=>array('categories'=>array('nama1','nama2','nama3','nama4','nama5'),),
      'yAxis'=> array(
            'min'=> 0,
            'title'=> array(
            'text'=>'Jumlah'
            ),
        ),
      'series' => array(
         array('data' => array(4,6,2,9,7))
      ),
      'tooltip' => array('formatter' => 'js:function() {return "<b>"+ this.x +"</b><br/>"+"Jumlah : "+ this.y; }'),
      'plotOptions'=>array('pie'=>(array(
                    'allowPointSelect'=>true,
                    'showInLegend'=>true,
                    'cursor'=>'pointer',
                )
            )
        ),
      'credits'=>array('enabled'=>false),
   )
));


i don't know how to integrate it
thank you
0

#2 User is offline   koukiya 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 27
  • Joined: 19-August 11

Posted 26 August 2011 - 10:35 AM

please, any help :-(
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