-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
64 lines (64 loc) · 2.2 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
<!DOCTYPE html>
<html style="height: 100%">
<head>
<meta charset="utf-8">
</head>
<body style="height: 100%; margin: 0">
<div id="container" style="width:60%;height: 60%"></div>
<script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts-all-3.js"></script>
<script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
option = null;
option = {
title: {
text: 'echarts3的折线图分段显示不同的颜色',
left: 'center',
link: 'http://phping.sinaapp.com'
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c}'
},
legend: {
left: 'left',
data: ['指数']
},
xAxis: {
type: 'category',
name: 'x',
splitLine: {show: false},
data: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
yAxis: {
type: 'log',
name: 'y'
},
series: [
{
name: '指数',
type: 'line',
data:[]
},
{
name: '指数',
type: 'line',
data:[]
}
]
};
if (option && typeof option === "object") {
var startTime = +new Date();
option.series[0].data = [4, 8, 16, 32, 64,'-','-'];
option.series[1].data = ['-','-','-','-',64,128,256];
myChart.setOption(option, true);
}
</script>
</body>
</html>