series组件
series: [{name: 'Top 5',type: 'scatter',coordinateSystem: 'bmap',data: convertData(data.sort(function (a, b) {return b.value - a.value;}).slice(0, 6)),symbolSize: 20,encode: {value: 2},showEffectOn: 'render',rippleEffect: {brushType: 'stroke'},label: {formatter: '{b}',position: 'right',show: true},itemStyle: {color:function(d){var a= d.data.value[2];console.log(d.data.value[2]);if(a % 2 == 0){return 'red';}else{return 'green';}},shadowBlur: 10,shadowColor: '#333'},emphasis: {scale: true},zlevel: 1}]
核心代码
itemStyle: {color:function(d){var a= d.data.value[2];console.log(d.data.value[2]);if(a % 2 == 0){return 'red';}else{return 'green';}},
@漏刻有时