实现效果:
echarts使用说明请查看:Vue中使用echarts实现常用图表总结
option配置:
option = {
legend: {
icon: 'rect',//形状 类型包括 circle,rect,line,roundRect,triangle,diamond,pin,arrow,none
itemWidth: 10, // 设置宽度
itemHeight: 4, // 设置高度
itemGap: 24, // 设置间距
data: ['温度', '湿度'],
textStyle: {
//文字样式
color: '#c1dafc',
fontSize: '12'
},
right: '30%',
selectedMode: 'single'