You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by 风雨同舟 <15...@qq.com> on 2021/05/20 11:23:34 UTC
3D 地球 globe,添加三维散点并添加点击事件,pc点击响应正常,移动端无响应
这是按照官网示例的代码
import * as echarts from "echarts";
import "echarts-gl";
var ROOT_PATH =
"https://cdn.jsdelivr.net/gh/apache/echarts-website@asf-site/examples";
var chartDom = document.getElementById("main");
var myChart = echarts.init(chartDom);
var option;
option = {
backgroundColor: "#000",
globe: {
baseTexture: ROOT_PATH + '/data-gl/asset/earth.jpg',
globeOuterRadius: 116,
shading: "lambert",
environment: ROOT_PATH + "/data-gl/asset/starfield.jpg",
atmosphere: {
show: true,
},
light: {
ambient: {
intensity: 0.1,
},
main: {
intensity: 1.5,
},
},
},
series: [
{
type: "scatter3D",
coordinateSystem: "globe",
symbolSize: 20,
label: {
show: true,
},
data: [
{
// 数据项的名称
name: "数据1",
// 数据项值
value: [100, 14, 10],
},
{
name: "数据2",
value: [34, 50, 15],
},
],
},
],
};
option && myChart.setOption(option);
myChart.on("click", function (params) {
console.log(params);
});
在移动端点击事件无响应。再此谢过支持本问题的解答