forked from minyiyou/airs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfatevent.html
More file actions
100 lines (83 loc) · 2.15 KB
/
fatevent.html
File metadata and controls
100 lines (83 loc) · 2.15 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- Load c3.css -->
<link href="c3.css" rel="stylesheet" type="text/css">
<!-- Load d3.js and c3.js -->
<script src="https://d3js.org/d3.v3.js"></script>
<script src="c3.js"></script>
<script src="jquery-3.1.1.js"></script>
<title>Document</title>
</head>
<body>
<br/>
<select id="range">
<option value='%Y'>By Year</option>
<option value='%Y%m'>By Month</option>
<option value='%Y%m%d'>By Day</option>
</select>
<br />
<div id="chart"></div>
</body>
<script type="text/javascript">
var time = '%Y';
var data = '%25Y';
var fatal = "Data/fat-"+data+".csv";
Plot = function(fatal,time){
var chart = c3.generate({
bindto: '#chart',
data: {
url: fatal,
type: 'area-step',
x: 'YMD',
xFormat: time,
},
axis: {
x: {
type: 'timeseries',
tick: {
format: time,
count : 110,
culling : {
max: 110
},
rotate: 75,
}
}
},
zoom: {
enabled: true,
rescale: true,
extent: [1, 1]
},
subchart: {
show: true,
size: {
height: 40
}
},
color:{
pattern:[
'#BE91C8'
]
},
});
};
Plot(fatal,time);
$(document).ready(function () {
$("#range").change(function () {
time = $("#range").find('option:selected').val();
if(time=='%Y%m%d'){
data = '%25Y%25m%25d'
}else if(time=='%Y%m'){
data = '%25Y%25m'
}else{
data = '%25Y'
};
fatal = "Data/fat-"+data+".csv";
Plot(fatal,time);
});
});
</script>
</html>