domingo, 18 de junio de 2017

Graficos en yii2

agregar al composer

"miloschuman/yii2-highcharts-widget": "dev-master",




<?php
use yii\helpers\Html;
use miloschuman\highcharts\Highcharts;
use yii\web\JsExpression;

/*use app\modules\student\models\StuMaster;
use \app\modules\course\models\Batches;
$this->title = Yii::t('course', 'Manage Course Modules');
$this->params['breadcrumbs'][] = $this->title;
$this->registerCss(".disp-count{cursor:default;} .disp-count:hover {background-color:none !important}");*/
?>
<?php
  echo Highcharts::widget([
    'scripts' => [
    'modules/exporting',
    'themes/grid-light',
    'highcharts-3d',
  ],
   'options' => [
   'exporting'=>[
      'enabled'=>true
    ],
    'credits'=>[
            'enabled'=>false
         ],
      'chart'=> [
        'type'=>'pie',
      ],
      'title' => ['text' => 'Fruit Consumption'],
      'xAxis' => [
         'categories' => ['Apples', 'Bananas', 'Oranges']
      ],
      'yAxis' => [
         'title' => ['text' => 'Fruit eaten']
      ],
      'series' => [
         ['name' => 'Jane', 'data' => [1, 0, 4]],
         ['name' => 'John', 'data' => [5, 7, 3]]
      ]
   ]
]);

?>

Actualizar composer yii2

sudo composer global require fxp/composer-asset-plugin:~1.3@dev