我尝试将Yii2 HighChart Widgets用于模型中的数据。
这是我的示例视图:
<?= \dosamigos\highcharts\HighCharts::widget([
'clientOptions' => [
'chart' => [
'type' => 'bar'
],
'title' => [
'text' => 'Fruit Consumption'
],
'xAxis' => [
'type' => 'datetime',
],
'yAxis' => [
'title' => [
'text' => 'Fruit eaten'
]
],
'series' => [
['name' => 'Jane', 'data' => [1, 0, 4]],
['name' => 'John', 'data' => [5, 7, 3]]
]
]
]);