项目上的需求,需要将第二个legend做成这种情况,这就需要分别对legend的样式做出定义
代码如下:
legend:[{
itemWidth:12,
itemHeight:12,
data:[{name:'数量',icon:'rect'}], //rect为矩形
bottom:5, //调整位置
left:'45%' //调整位置
},{
itemWidth:12,
itemHeight:2,
data:[{name:'价值',icon:'rect'}], //rect为矩形
bottom:5, //调整位置
right:'45%' //调整位置
}]
因为我已经设好了颜色,所以在这段legend代码中我不需要设置了,避免无意义代码出现,有需要的可以参考博文更加详细