如图所示,需要分别自定义legend的宽高
想要实现不同样式的图例,需要用数组写对应图例的样式
代码如下:
legend: [
{
data: ['降水量'],
left: '30%',
textStyle: {
color: '#9FC6F6'
},
icon: 'rect', // 形状
itemWidth: 7, // 宽
itemHeight: 7// 高
},
{
data: ['风速', '温度', '湿度'],
left: '40%',
textStyle: {
color: '#9FC6F6'
},
icon: 'rect',
itemWidth: 10,
itemHeight: 3
}
],