-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.html
92 lines (91 loc) · 3.15 KB
/
data.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html style="height: 100%">
<head>
<meta charset="utf-8">
</head>
<body style="height: 100%; margin: 0">
<div id="container" style="height: 100%"></div>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts/echarts.min.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts-gl/echarts-gl.min.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts-stat/ecStat.min.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts/extension/dataTool.min.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts/map/js/china.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts/map/js/world.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/echarts/extension/bmap.min.js"></script>
<script type="text/javascript" src="https://echarts.baidu.com/gallery/vendors/simplex.js"></script>
<script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
option = null;
let arr=[];
for(let i=0.5;i<20;i++){
arr.push(i);
for(let j=1;j<10;j++){
arr.push(i+0.1*j);
}
}
// let result1 = {};
// result1.buy=[];
// let result2 = {};
// result1.sell=[];
var result = [];
arr.forEach((val,index)=>{
console.log(val)
arr.forEach((v,i)=>{
result.push([val,v,247610*val-20350,22000*v-23650*val-61600])
/* result1.buy.push(val);
result1.buy.push(v);
result1.push(247610*val-20350)
result2.push(22000*v-23650*val-61600) */
})
})
var symbolSize = 2.5;
option = {
grid3D: {},
xAxis3D: {
type: 'category'
},
yAxis3D: {},
zAxis3D: {},
dataset: {
dimensions: [
'买入价',
'卖出价',
'行使收益',
'不行使收益',
// {name: 'Year', type: 'ordinal'}
],
source: result
},
series: [
{
type: 'scatter3D',
symbolSize: symbolSize,
encode: {
x: '买入价',
y: '卖出价',
z: '行使收益',
tooltip: [0, 1, 2]
}
},
{
type: 'scatter3D',
symbolSize: symbolSize,
encode: {
x: '买入价',
y: '卖出价',
z: '不行使收益',
tooltip: [0, 1, 2]
}
}
]
};
myChart.setOption(option);
;
if (option && typeof option === "object") {
myChart.setOption(option, true);
}
</script>
</body>
</html>