Toggle navigation
gauge实现仪表盘
By
雨***1
2020-01-16 07:39:34
脚本
16
21
作品使用的第三方脚本
https://echarts.baidu.com/resource/echarts-liquidfill-latest/dist/echarts-liquidfill.min.js
数据管理
上传数据
支持小于 5M 任意格式(csv, xlsx, json, xml, ...)的数据文件
上传后可以通过生成的文件链接异步获取托管的数据。
历史数据
0 条
无历史数据
代码修改记录
信息提示
保存作品
对当前截图不满意?你还可以
上传本地截图
重新截图
作品名称
作品描述
标签
geo
grid
legend
markLine
markPoint
bar
effectScatter
line
lines
map
timeline
title
toolbox
tooltip
visualMap
作品默认版本
最新
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
20:11:45
图表已生成
整理代码
刷新
代码
option = { tooltip: { formatter: "{a}
{b} : {c}" }, series: [{ //类型 type: 'gauge', //半径 radius: 80, //起始角度。圆心 正右手侧为0度,正上方为90度,正左手侧为180度。 startAngle: 180, //结束角度。 endAngle: 0, center: ['50%', '70%'], //仪表盘轴线相关配置。 axisLine: { show: true, // 属性lineStyle控制线条样式 lineStyle: { width: 10, color: [ [0.23, '#2f808f'], [1, '#d8e8f2'] ] } }, //分隔线样式。 splitLine: { show: false, }, //刻度样式。 axisTick: { show: false, }, //刻度标签。 axisLabel: { show: false, }, //仪表盘指针。 pointer: { //这个show属性好像有问题,因为在这次开发中,需要去掉指正,我设置false的时候,还是显示指针,估计是BUG吧,我用的echarts-3.2.3;希望改进。最终,我把width属性设置为0,成功搞定! show: false, //指针长度 length: '90%', width: 0, }, //仪表盘标题。 title: { show: true, offsetCenter: [0, '25%'], // x, y,单位px textStyle: { color: '#36ce9b', } }, //仪表盘详情,用于显示数据。 detail: { show: true, offsetCenter: [0, '-25%'], formatter: '{value}'+'%', }, data: [{ value: 23, name: '仪表盘总数'+'58', }, ] }] };