每日一唠叨:
要求:
1、由于做三语个别英文会显示很长,换成竖着显示图例
2、动态数据单个显示不同颜色与随机显示颜色
解决方法
1、legend的值要跟series里面的name一致,不然不显示。
legend: {
data: this.xData,
icon: 'rect',
orient: 'vertical',
top: '5',
left:'left',
},
2、
// 随机颜色
color:function(data){
return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16)
},
// 固定颜色
color:function(params){
var color=["#e1c490","#5470c6",'#91cc75']
return color[params.dataIndex]
},