I want to create dual axes Highchart like as seen in image and i have install miloschuman\highcharts\Highcharts extension.
My yii2 code
<?php
use miloschuman\highcharts\Highcharts;
$emp = ['zxc', 'sdf', 'fgh', 'ggg'];
$totalData[] = ['name' => 'Total', 'type' => 'column', 'data' => [23,45,34,34]];
$avgData[] = ['name' => 'Avarage', 'type' => 'spline', 'data' => [2.3,4.5,3.4,3.0]];
echo Highcharts::widget([
'options' => [
'chart'=>[
//'type'=>'column',
'zoomType' => 'xy',
],
'exporting'=>[
'enabled'=>false,
],
'credits'=>[
'enabled'=>false,
],
'title'=>[
'text'=>Yii::t('comm', $model->fg_name),
],
'subtitle'=>[
'text'=>'',
'margin'=>0,
],
'xAxis'=>[
'type' => 'category',
'labels' => [
'rotation' => -45,
'style' => [
'fontSize' => '13px',
'fontFamily' => 'Verdana, sans-serif'
]
],
'categories'=> $emp,
'title'=>[
'text'=>'<b>'.Yii::t('comm', 'Employee').'</b>',
],
],
'yAxis'=>[
'title'=>[
'text'=>Yii::t('comm', 'TOTAL/AVARAGE'),
],
],
'legend' => [
'enabled' => false
],
'plotOptions'=>[
'column'=>[
'pointPadding'=>0.2,
'borderWidth'=>0
],
],
'series'=> [$avgData,$totalData]
],
]);
?>