highchart yii2

how to pass dynamic value in highchart (bar chart/pie chart)

my code but not work

echo Highcharts::widget([

'scripts' => [


    'modules/exporting',


    'themes/grid-light',


],


'options' => [


    'title' => [


        'text' => 'Revenue Chart ',


    ],


    'xAxis' => [


        'categories' => $data1,


    ],


    'labels' => [


        'items' => [


            [


                'html' => 'Revenue chart',


                'style' => [


                    'left' => '50px',


                    'top' => '18px',


                    'color' => new JsExpression('(Highcharts.theme && Highcharts.theme.textColor) || "black"'),


                ],


            ],


        ],


    ],


    'series' => array(


       array(


            'type' => 'column',


            'name' => 'Jane',


            'data' => $listData,


            


        ),





       


       ),


    ],

]);

query ans:

list data

array

(

[1] => 10


[2] => 20

)

$data= show the month


     

[b]In VIEWS[/b]

use miloschuman\highcharts\Highcharts;

use miloschuman\highcharts\Highmaps;

use yii\web\JsExpression;


$countProject = $dataProject->count(); 

<?php 

 $this->registerJsFile('http://code.highcharts.com/mapdata/countries/de/de-all.js', [

    'depends' => 'miloschuman\highcharts\HighchartsAsset'

]);

 

$totalP = array_map('intVal', $totalCountP); 

?>

 <?php 

echo Highcharts::widget([

    'scripts' => [

        'modules/exporting',

        'themes/grid-light',

    ],

    'options' => [

        'title' => [

            'text' => 'Project chart',

        ],

        'xAxis' => [

            'categories' => $fourActualMonth    ,//month

        ],

        'yAxis' => [

             'title' => [

            'text' => 'Count',

        ],

        ],   

        'series' => [

           

            [

                'type' => 'column',

                'name' => 'Project',

                'data' => $totalP,

            ],

             

           

             

        ],

    ]

]);


[b]In CONTROLLER[/b]




return $this->render('index', [

            'searchModel' => $searchModel,

            'dataProvider' => $dataProvider,

           'totalCountP' => $resultProject,  // array project count on month base

           'fourActualMonth' => $fourActualMonth,// current four months

              

        ]);