yii2-highcharts-widget
yii2-highcharts-widget copied to clipboard
How to format Y-Axis ?
How to format Y-Axis ? i want to prefix or postfix $ symbol on Y-Axis. i checked HighChart documentation there is option to do like this
yAxis: {
title: { text: 'Temperature (Celsius)' } ,
labels: {
formatter: function() {
return this.value + '$';
}
}
}
how to integrate same thing inthis widget(how to call this anonymous function via php )
$yAxisConfig = [
'title' => [
'text' => $yaxisTitle
],
'labels'=>[
'formatter'=>function(){
return $this.value . '$';
},
]
];
echo \dosamigos\highcharts\HighCharts::widget([
'clientOptions' => [
'chart' => [
'type' => $searchModel->graphType?$searchModel->graphType:'line',
],
'title' => [
'text' => 'Facility Order Report'
],
'xAxis' => [
'categories' => $categoriesDate
],
'yAxis' => $yAxisConfig,
'series' => $dataArray
]
]);
i tried many ways but its not working can you guide how to achieve though widget.