echarts中的globe在使用scatter3D后,如何用自动的显示tooltip?
使用了echarts-4.1.0,echarts-gl-1.1.1,在globe中我使用了scatter3D绘制散点图,在option中配置的tooltip可以正常显示,但使用dispatchAction就无法呼出tooltip,同样的方法我放在2D的图中就是正常的。
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
})
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
貌似gl还不支持tooltip功能,如果可以,你可以用label来实现
望解答,已经试过很多种方法后都无效