~~~
return TBuilder('custom') ->layoutView('layout_simple')
->row()
->groupEcharts([
'panel_id'=> 'pchart2',
'panel_icon'=> 'fa fa-pencil',
'panel_title'=> '每日测评人次统计',
'echart_data'=> $projectStatisticsInfo['all_project_join_day_gather'],
'echart_type'=> [
[
'tab_title'=> '折线图',
'echart-config'=> '{type:"line",name_key:"day",value_key:"count",data_name:"每日测评人次"}',
'echart-option'=> '{title:{},yAxis: {type: "value",axisLabel: {formatter: "{value} 人次"}}}'
],
[
'tab_title'=> '饼状图',
'echart-config'=> '{type:"pie",name_key:"day",value_key:"count",data_name:"每日测评人次"}',
'echart-option'=> '{title:{}}'
]
]
])
->fetch();
~~~
![](https://box.kancloud.cn/260bcca2e734125ca718f670d6817a68_1723x516.png)
![](https://box.kancloud.cn/680b4e3748fa7f27bd058903e8a4378c_1432x406.png)
数据格式(上例:all_project_join_day_gather)
~~~
'all_project_join_day_gather' =>
array (size=5)
0 =>
array (size=2)
'count' => int 1
'day' => string '2017-08-21' (length=10)
1 =>
array (size=2)
'count' => int 1
'day' => string '2017-08-23' (length=10)
2 =>
array (size=2)
'count' => int 2
'day' => string '2017-08-24' (length=10)
3 =>
array (size=2)
'count' => int 1
'day' => string '2017-08-29' (length=10)
4 =>
array (size=2)
'count' => int 2
'day' => string '2017-08-30' (length=10)
~~~
混合table
~~~
->groupEcharts([
'panel_id'=> 'pchart2',
'panel_icon'=> 'fa fa-pencil',
'panel_title'=> '测评总测评人次',
'echart_data'=> $projectStatisticsInfo['project_join_gather'],
'echart_type'=> [
[
'tab_title'=> '饼状图',
'echart-config'=> '{type:"pie",name_key:"project_name",value_key:"count",data_name:"测评总测评人次"}',
'echart-option'=> '{title:{}}'
],
[
'tab_title'=> '柱状图',
'echart-config'=> '{type:"bar",name_key:"project_name",value_key:"count",data_name:"测评总测评人次"}',
'echart-option'=> '{title:{},yAxis: {type: "value",axisLabel: {formatter: "{value} 人次"}}}'
]
],
'table'=> [
//'tab_col'=> 6,
'list'=> $projectStatisticsInfo['project_join_gather'],
'columns'=> [
['project_name','项目名称'],
['count','测评人数'],
]
]
])
~~~
![](https://box.kancloud.cn/6983ea2a9290fa3334a522f3c39150ad_1372x408.png)
![](https://box.kancloud.cn/7b15a0ea9730f60d6644669ce9b0baa0_1358x393.png)
数据格式(上例:project_join_gather)
~~~
'project_join_gather' =>
array (size=2)
0 =>
array (size=3)
'project_id' => int 2
'count' => int 6
'project_name' => string '中级PHP工程师' (length=18)
1 =>
array (size=3)
'project_id' => int 7
'count' => int 1
'project_name' => string '极速职业测评' (length=18)
~~~
其他案例:
![](https://box.kancloud.cn/68dcad6dc0176ebf8b6e6d98945feb69_1328x388.png)