合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
## 动态仪表图 ![](https://img.kancloud.cn/91/dc/91dcebb7ac91bc7b9248c31f83daa929_1104x704.png) ~~~[api] post:index/t.gauge <<< success { "succeed": 1 "msg": "提示信息", "data": { "value":"初始化仪表显示值", "min":"最小刻度", "max":"最大刻度", "axisLine":[ "width":"刻度盘的宽度", "color":[{"百分比(小数)","颜色"}] ], "axisTick":[ "distance":"与刻度盘间距,一般为刻度盘宽度的负值" "length":"长度", "width":"宽度" ] , //>小刻度配置 "splitLine":[ "distance":"与刻度盘间距,一般为刻度盘宽度的负值" "length":"长度", "width":"宽度" ] , //>大刻度配置 "axisLabel":[ "distance":"与刻度盘间距,默认:10" "fontsize":"字体大小" ] , //>刻度值 "detail":[ "unit":"刻度值单位,如:km/s", "fontsize":"字体大小" ], //>说明 "url": "请求地址,若为字符串则为api中的地址,如果为数组则为model中的地址", "second": "动态获取值的间隔时间,毫秒值", "param":"请求间隔时间,毫秒数" "loop": "下一个循环标识(若卡片加载完则不需要填写)", } } <<< error { "succeed": 0, "msg": "提示信息" } ~~~ ~~~ $data = []; $data['value'] = 0; //>初始化数据 $data['min'] = 0; //>仪表最小值 $data['max'] = 200; //>仪表最大值 //>刻度盘设置 $obj = $tmp = []; $tmp[] = ['0.3','#67e0e3']; $tmp[] = ['0.7','#37a2da']; $tmp[] = ['1','#fd666d']; $obj['color'] = $tmp; $obj['width'] = 20; $data['axisLine'] = $obj; //>小刻度设置 $obj = []; $obj['distance'] = -20; //>与刻度盘之前间距 $obj['length'] = 8; //>长度 $obj['width'] = 2; //>宽度 $data['axisTick'] = $obj; //>大刻度设置 $obj = []; $obj['distance'] = -20; //>与刻度盘之前间距 $obj['length'] = 20; //>长度 $obj['width'] = 4; //>宽度 $data['splitLine'] = $obj //>刻度值设置 $axisLabel = []; $axisLabel['distance'] = 10; //>与刻度盘之前间距 $axisLabel['fontsize'] = 14; //>值字体大小 $data['axisLabel'] = $axisLabel; //>说明设置 $detail = []; $detail['unit'] = 'km/s'; //>单位 $detail['fontsize'] = 20; //>说明字体大小 $data['detail'] = $detail; //>动态数据请求 $data['second'] = '2000'; //>请求间隔时间,毫秒 $data['url'] = 'index/p.gauge'; //>请求地址,若为字符串则为api中的地址,如果为数组则为model中的地址 $data['param'] = ['P'=>1]; //>请求参数 $json['data'] = $data; ~~~