ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 环形饼图 ~~~[api] post:index/t.annular <<< success { "succeed": 1 "msg": "提示信息", "data":{ "option":{ 柱状图配置信息 } } "loop": "下一个获取柱状图配置的标识", } <<< error { "succeed": 0, "msg": "提示信息" } ~~~ ## 配置示例-参考:[Echart 示例](https://echarts.apache.org/examples/zh/index.html) ![](https://img.kancloud.cn/ea/c3/eac3487da99f18073c3e8db12d454eca_486x301.png) ~~~ $data = []; //>提示框组件 $obj = []; $obj['trigger'] = 'item'; //>数据项图形触发 $data['tooltip'] = $obj; //>图例组件 $obj = []; $obj['top'] = '5%'; //>垂直距离容易顶部5% $obj['left'] = 'center'; //>水平居中 $data['legend'] = $obj; //>饼图 $obj = []; $obj['name'] = '访问来源'; //>系列名称 $obj['type'] = 'pie'; //>饼图 $obj['radius'] = ['40%','70%']; //>[内半径,外半径] $obj['avoidLabelOverlap'] = FALSE; //>关闭防止标签重叠策略 $tmp = []; $tmp['borderRadius'] = 10; //>圆角半径 $tmp['borderColor'] = '#FFF'; //>图形的描边颜色 $tmp['borderWidth'] = 2; //>描边线宽 $obj['itemStyle'] = $tmp; //>图形样式 $tmp = []; $tmp['show'] = FALSE; //>不显示 $tmp['position'] = 'center'; //>标签居中 $tmp['formatter'] = '{b}'. chr(10).'{c}'; //>标签内容格式器 $obj['label'] = $tmp; //>饼图图形上的文本标签 $tmp = []; $tmp['show'] = TRUE; //> 显示标签 $tmp['fontSize'] = '20'; //>文字的字体大小 $tmp['fontWeight'] = 'bold'; //>文字字体的粗细 $obj['emphasis']['label']= $tmp; //>高亮状态的扇区和标签样式 $obj['labelLine'] = ['show'=>FALSE]; //>不显示视觉引导线 $tmp = []; $tmp[] = ['value'=>1048,'name'=>'搜索引擎']; $tmp[] = ['value'=>735,'name'=>'直接访问']; $tmp[] = ['value'=>580,'name'=>'邮件营销']; $tmp[] = ['value'=>484,'name'=>'联盟广告']; $tmp[] = ['value'=>300,'name'=>'视频广告']; $obj['data'] = $tmp; //>数据内容数组 $data['series'][] = $obj; $json['data']['option'] = $data; ~~~