-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
62 lines (59 loc) · 1.73 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html style="height: 100%">
<head>
<meta charset="utf-8">
<title>3D Scatter Plot with ECharts</title>
<!-- 引入 ECharts 主文件 -->
<script src="echarts.min.js"></script>
<!-- 引入 ECharts GL 模块 -->
<script src="echarts-gl.min.js"></script>
<!-- 引入包含 Data 变量的 JavaScript 文件 -->
<script src="echarts_data.js"></script>
</head>
<body style="height: 100%; margin: 0">
<div id="main" style="height: 600px"></div>
<script type="text/javascript">
// 假设 Data 变量已经从 eData.js 中加载
var data = alldata;
var myChart = echarts.init(document.getElementById('main'));
var option = {
tooltip: {
show: true
},
grid3D: {
viewControl: {
projection: 'perspective'
}
},
xAxis3D: {
type: 'value',
name: 'l_s_1'
},
yAxis3D: {
type: 'value',
name: 'l_s_2'
},
zAxis3D: {
type: 'value',
name: 'ratio'
},
dataset: {
dimensions: ['l_s_1', 'l_s_2', 'ratio'],
source: data
},
series: [
{
type: 'scatter3D',
symbolSize: 10, // 可以设置一个固定的大小,或者根据数据动态计算
encode: {
x: 'l_s_1',
y: 'l_s_2',
z: 'ratio'
}
}
]
};
myChart.setOption(option);
</script>
</body>
</html>