qq_39604706
2018-12-13 04:10 阅读 1.7k

echarts在3d地球中dispatchAction无效?

var globel = echarts.init(document.getElementById('globe'));

        const option = {
            // backgroundColor: '#000',
            visualMap: {
                show: false,
                min: 0,
                max: 60,
                inRange: {
                    symbolSize: [1.0, 10.0],
                    opacity:[1,0.5]
                }
            },
            tooltip: {
                trigger: 'item',
                alwaysShowContent:true,
                formatter: function(prams,d,callback){
                    return prams.value
                },
            },
            globe: {
                baseTexture: require('../assets/world.png'),
                globeOuterRadius: 100,
                displacementScale: 0.1,
                viewControl:{
                    autoRotate:false
                },
                postEffect:{
                    bloom:true,
                    screenSpaceAmbientOcclusion:true
                },
                shading: 'color',
                z: 9
            },
            series: {
                type: 'scatter3D',
                coordinateSystem: 'globe',
                blendMode: 'source-over',
                symbolSize: 2,
                itemStyle: {
                    // color: 'rgb(148, 148, 148)',
                    color:'#b4b4b4',
                    opacity: 1
                },
                data: data
            }
        }
*******************************
        globel.dispatchAction({
            type:'showTip',
            seriesIndex:0,
            dataIndex:1
        })

如上,无论如何都无法用方法呼出tooltip,但是正常的item触发还是可以的

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

相关推荐