echarts关于仪表盘的配置
option = { tooltip: { formatter: '{a} <br/>{b} : {c}%' }, toolbox: { feature: { restore: {}, saveAsImage: {} } }, series: [ { name: '业务指标', startAngle: 220, endAngle: -40, type: 'gauge', detail: { formatter: '{value}%', color: '#ff6700' }, axisLabel:{ distance:-55 }, splitNumber: 4, axisLine: { show: true }, splitLine: { show: false }, axisTick: { show: false }, pointer: { show: false }, axisLine: { lineStyle: { color: [[0.35, '#ff6700'], [1, '#23c023']] } }, data: [{value: 35, name: '今日饮水量'}], title: { // 仪表盘标题。 show: true, // 是否显示标题,默认 true。 offsetCenter: [0,"80%"],//相对于仪表盘中心的偏移位置,数组第一项是水平方向的偏移,第二项是垂直方向的偏移。可以是绝对的数值,也可以是相对于仪表盘半径的百分比。 color: "#ff6700", // 文字的颜色,默认 #333。 fontSize: 20, // 文字的字体大小,默认 15。 }, } ], };
配置结果
本想把生活活成一首诗, 时而优雅 , 时而豪放 , 结果活成了一首歌 , 时而不靠谱 , 时而不着调