-
Notifications
You must be signed in to change notification settings - Fork 73
/
index.html
169 lines (168 loc) · 4.96 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="echarts.js"></script>
</head>
<body>
<div id="main" style="width:1000px; height:1800px"></div>
<script type="text/javascript" src="data.json"></script>
<script type="text/javascript">
// Get data from json file
var mydata = JSON.parse(data);
var timeData = mydata.date;
var priceData = mydata.price;
var growData = mydata.growth_60_day;
var hotData = mydata.hot;
var bubbleData = mydata.bubble
// Init echarts
var myChart = echarts.init(document.getElementById('main'));
// set option
var option = {
title: {
text: 'Bitcoin Bubble Index',
x: 'center'
},
axisPointer: {
link: {xAxisIndex: 'all'}
},
tooltip: {
trigger: 'axis',
axisPointer: {
animation: false
}
},
legend: {
right: 100,
top: 30,
data:['linear scale','log scale'],
},
dataZoom: [{
show: true,
realtime: true,
start: 0,
end: 100,
xAxisIndex: [0,1,2,3]
}],
grid: [{
left: 100,
top: '6%',
height: '18%'
},{
left: 100,
top: '30%',
height: '18%'
},{
left: 100,
top: '54%',
height: '18%'
},{
left: 100,
top: '78%',
height: '18%'
}],
xAxis: [{
type : 'category',
boundaryGap : false,
axisLine: {onZero: true},
data: timeData
}, {
gridIndex: 1,
type : 'category',
boundaryGap : false,
axisLine: {onZero: true},
data: timeData
}, {
gridIndex: 2,
type : 'category',
boundaryGap : false,
axisLine: {onZero: true},
data: timeData
}, {
gridIndex: 3,
type : 'category',
boundaryGap : false,
axisLine: {onZero: true},
data: timeData
}],
yAxis: [
{
name : 'BTC Price (USD)',
type : 'value'
},
{
type : 'log'
},
{
gridIndex: 1,
name : '60 days Cumulative Increase (%)',
type : 'value'
},
{
gridIndex: 2,
name : 'Hot Keywords (google + twitter)',
type : 'value'
},
{
gridIndex: 3,
name : 'Bubble Index',
type : 'value'
}
],
series : [
{
yAxisIndex : 1,
name : 'log scale',
type : 'line',
hoverAnimation : false,
data : priceData,
markLine: {
data: [{
name: 'first halfing',
xAxis: '2012/11/28'
}, {
name: 'second halfing',
xAxis: '2016/07/10'
}]
}
},
{
name : 'linear scale',
type : 'line',
smooth : true,
hoverAnimation : false,
data : priceData
},
{
xAxisIndex: 1,
yAxisIndex: 2,
name : '60 days CI (%)',
type : 'line',
smooth : true,
hoverAnimation : false,
data : growData
},
{
xAxisIndex: 2,
yAxisIndex: 3,
name : 'Hot Keywords',
type : 'line',
smooth : true,
hoverAnimation : false,
data : hotData
},
{
xAxisIndex: 3,
yAxisIndex: 4,
name : 'Bubble Index',
type : 'line',
smooth : true,
hoverAnimation : false,
data : bubbleData
}
]
}
myChart.setOption(option);
</script>
</body>
</html>