🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 面积图 ![](https://img.kancloud.cn/60/5e/605e0980cef54601c842785b61e6cad7_1106x1000.png) ~~~[api] post:index/t.area <<< success { "succeed": 1 "msg": "提示信息", "data": { "x": "X轴数组", "y": "Y轴数组", "title":"标题, "color1":"渐变初始色", "color2":"渐变结束色", "name": "数据说明" "loop": "下一个循环标识(若卡片加载完则不需要填写)", } } <<< error { "succeed": 0, "msg": "提示信息" } ~~~ ~~~ $data = []; $basedate = strtotime('1968-9-3'); $data_arr = $date = []; $randfloat = randfloat(); $data_arr[] = floor($randfloat*300); $date[] = date('Y/m/d',$basedate); for($i=1;$i<10000;$i++){ $basedate = $basedate+24*3600*3; $date[] = date('Y/m/d',$basedate); $randfloat = randfloat(); $data_arr[] = floor(($randfloat-0.48)*20 + $data_arr[$i-1]); } //>数据 $data['x'] = $date; $data['y'] = $data_arr; //>标题 $data['title'] = '标题'; //>数据名称 $data['name'] = '数据说明'; //>渐变颜色 $data['color1'] = 'rgb(255, 70, 131)'; $data['color2'] = 'rgb(255, 158, 68)'; $json['data'] = $data; ~~~