-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
176 lines (174 loc) · 4.55 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
169
170
171
172
173
174
175
176
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ECharts</title>
<!-- 引入 echarts.js -->
<script src="echarts.js"></script>
</head>
<body>
<style>
body {
height:100%;
width: 100%;
margin: 0;
}
</style>
<!-- 为ECharts准备一个具备大小(宽高)的Dom -->
<div id="main" style="width:100%;height:346px;background-color:#494A5F;"></div>
<script type="text/javascript">
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'),);
// 指定图表的配置项和数据
option = {
color: ['#1ABC9C', '#EDBC34', '#049DFF'],
title: {
text: '血压/脉率变化趋势(平均值)',
textStyle: {
color: '#FFF'
},
left: 'center'
},
tooltip: {
trigger: 'axis',
},
legend: {
textStyle: {
color: '#FFF'
},
bottom: '0%',
data:['收缩压','舒张压','脉率'],
selected: {
'收缩压': true, '舒张压': true, '脉率': false
}
},
grid: {
left: '5%',
right: '3%',
top: '16%',
bottom: '7%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],
axisPointer: {
type: 'shadow'
},
axisLabel: {
textStyle: {
color: '#fff'
}
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#fff',
width:'2'
}
}
}
],
yAxis: [
{
type: 'value',
name: '血压(mmHg)',
min: 40,
max: 180,
interval: 20,
axisLabel: {
formatter: '{value}',
textStyle: {
color: '#fff'
}
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#fff',
width:'2'
}
}
},
{
type: 'value',
name: '脉率(bpm)',
min: 40,
max: 110,
interval: 10,
axisLabel: {
formatter: '{value}',
textStyle: {
color: '#fff'
}
},
axisLine: {
lineStyle: {
type: 'solid',
color: '#fff',
width:'2'
}
}
},
],
series: [
{
name:'收缩压',
type:'line',
data:[115, 123, 121, 129, 110, 114, 130, 120, 119, 126, 113, 116],
markArea: {
itemStyle: {
color: 'rgb(225, 0, 0,0.4)'
},
label: {
color: '#FFF',
fontWeight: 'bolder',
position: 'insideLeft',
},
data: [ [{
name: '标\n准\n血\n压\n范\n围',
yAxis: '80'
}, {
yAxis: '120'
}],
],
silent: true
}
},
{
name:'舒张压',
type:'line',
data:[87, 75, 78, 72, 69, 75, 80, 80, 79, 85, 67, 79],
markArea: {
itemStyle: {
color: 'rgb(225, 0, 0,0.4)'
},
label: {
color: '#FFF',
fontWeight: 'bolder',
position: 'insideLeft',
},
data: [ [{
name: '标\n准\n血\n压\n范\n围',
yAxis: '80'
}, {
yAxis: '120'
}],
],
silent: true
}
},
{
name:'脉率',
type:'line',
yAxisIndex: 1,
data:[76, 66, 69, 72, 80, 68, 74, 75, 78, 66, 65, 69]
},
]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
</script>
</body>
</html>