$data=[['name'=>'apple','value'=>50],['name'=>'banana','value'=>20],['name'=>'orange','value'=>10],['name'=>'peach','value'=>30],['name'=>'strawberry','value'=>40],['name'=>'watermelon','value'=>15]];
``` 接下來我們需要構(gòu)建圖表的參數(shù)。以餅圖為例: ```$option=[
'title'=>['text'=>'Fruit Sales'],
'tooltip'=>['trigger'=>'item','formatter'=>'{a}
: {c} (okeek0k%)'],
'legend'=>['orient'=>'vertical','left'=>'left','data'=>array_column($data,'name')],'series'=>[['name'=>'Fruit Sales','type'=>'pie','radius'=>['50%', '70%'],'avoidLabelOverlap'=>true,
'label'=>['show'=>false,'position'=>'center'],
'emphasis'=>['label'=>['show'=>true,'fontSize'=>'30','fontWeight'=>'bold','formatter'=>'\n{c} (2gk20am%)']],
'labelLine'=>['show'=>true],'data'=>$data]]];