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 2018/11/09 05:53:06 UTC

[GitHub] DorisOu commented on issue #9371: 自定义系列的 polygon 绘制,点击下钻和对应的散点图

DorisOu commented on issue #9371: 自定义系列的 polygon 绘制,点击下钻和对应的散点图
URL: https://github.com/apache/incubator-echarts/issues/9371#issuecomment-437258173
 
 
   @pissang 好的,谢谢您的宝贵意见,我再试下。
   再问个关于legend切换的问题:第一个legend展示两张图,polygon绘制用visualMap映射各个区域颜色和柱状图显示所有区域人数排名(已经实现),第二个legend展示polygon绘制上面显示各个小区的散点(已经实现)。
   切换legend显示不同的图表(已经实现):控制切换代码的这个函数总是感觉有问题,代码很冗长。echart有没有更好的办法?我看过那个brush可选区域的,就是一个函数里定义了几个data的值,series里的值是 [];
   
   function renderSelected(params) {
           var selected = params.selected;
           if (selected['镇人口分布']) {
               scatterMap.setOption(option = {
                   visualMap: {
                       show: true
                   },
                   series: [{
                       id: 'bar',
                       zlevel: 2,
                       type: 'bar',
                       symbol: 'none',
                       itemStyle: {
                           normal: {
                               color: '#ddb926'
                           }
                       },
                       data: regionData(paths)
                   }],
                   yAxis: {
                       data: getName(paths)
                   }
               });
           } else {
               scatterMap.setOption(option = {
                   visualMap: {
                       show: false
                   },
                   series: [{
                       id: 'bar',
                       zlevel: 2,
                       type: 'bar',
                       symbol: 'none',
                       itemStyle: {
                           normal: {
                               color: '#ddb926'
                           }
                       },
                       data: []
                   }],
                   yAxis: {
                       data: []
                   }
               });
           }
       }
   scatterMap.on('legendselectchanged', renderSelected);
   
   希望可以用到echart里的配置项实现;

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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