You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/06/12 06:27:34 UTC

[GitHub] [incubator-echarts] prodigaLaugh opened a new issue #10660: geo effectScatter itemStyle下不能设置不同的color

prodigaLaugh opened a new issue #10660: geo effectScatter itemStyle下不能设置不同的color
URL: https://github.com/apache/incubator-echarts/issues/10660
 
 
   var validater = nodeInfo[item[0]].validater
             const circleColor = validater===1?'rgb(128, 128, 128)':validater===2?'rgb(0, 255, 255)':'red';
   
             series.push(
             
             {
                 name: item[0] + ' Top10',
                 type: 'lines',
                 zlevel: 2,
                 // symbol: ['none', 'arrow'],
                 lineStyle: {
                   normal: {
                       // color: color[i],
                       color:'blue',
                       type:'dashed',
                       width: 1,
                       opacity: 0.6,
                   }
                 },
                 data: convertData(item[1])
             },
             {
                 name: item[0] + ' Top9',
                 type: 'effectScatter',
                 coordinateSystem: 'geo',
                 zlevel: 2,
                 
                 label: {
                   normal: {
                     show: false,
                     position: 'right',
                     formatter: '{b}'
                   }
                 },
                 symbolSize: 10,
                 // itemStyle: {
                 //   color: circleColor,
                 //   normal: {
                 //     color: circleColor,
                 //   }
                 // },
                 data: item[1].map(function (dataItem) {
                   return {
                     symbolSize: 5,
                     name: dataItem[1].name,
                     itemStyle: {
                       color:circleColor,
                       normal: {
                         color: circleColor,
                       }
                     },
                     
                     value: geoCoordMap[dataItem[1].name].concat([dataItem[1].value])
                   };
                 })
             });
         });
   const option = {
             
             backgroundColor: '#fff',
             color:color,
             title : {
                 text: '',
                 subtext: '',
                 left: 'center',
                 textStyle : {
                     color: '#fff'
                 }
             },
             tooltip : {
                 trigger: 'item'
             },
             geo: {
                 map: 'china',
                 label: {
                   emphasis: {
                     show: false
                   }
                 },
                 roam: true,
                 itemStyle: {
                   normal: {
                     areaColor: 'lightblue',
                     borderColor: '#aaa'
                   },
                   emphasis: {
                     areaColor: 'blueviolet'
                   }
                 }
             },
             series: series
         };
         myChart.setOption(option);
   
   原型是这样的(不同的节点显示不同颜色的圆点):
   ![1560320668895](https://user-images.githubusercontent.com/23735606/59328014-e1995080-8d1d-11e9-876f-c7b30c4c21e6.jpg)
   
   实现的是这样的(圆点只有一种颜色):
   ![1560320742642](https://user-images.githubusercontent.com/23735606/59328131-32a94480-8d1e-11e9-990d-53935f9e81f2.jpg)
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org