-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
127 lines (104 loc) · 4.08 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/litepicker/dist/js/main.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/litepicker/dist/css/style.css"></script> -->
<!-- chart js dependancies -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<style>
#litepicker,
#litepickerEnd {
display: inline-block;
border-radius: 6px;
max-width: 200px;
width: 100%;
border: 1px solid #ddd;
border-top: none;
font-size: 1.3em;
text-align: center;
margin: .5rem;
}
</style>
<div class="wrapper">
<label for="litepicker">Choose Period</label>
<input onclick="changePeriodRange()" id="litepicker" type="text">
<input id="litepickerEnd" type="text" onclick='changePeriodRange()'>
</div>
<div class="wrapper">
<div class="div">
<label for="country">Choose country</label>
<select name="country" id="country">
</select>
</div>
<div>
<label for="status">Choose status</label>
<select name="status" id="status">
<option value="total" selected>Total Cases</option>
<option value="active">Active Cases</option>
<option value="recovered">Recovered Cases</option>
<option value="deaths">Deaths</option>
</select>
</div>
</div>
<button type="submit" onclick="changeCountry()">Update chart</button>
<canvas id="covid19"></canvas>
<script>
// period picker initializer with options
let picker = new Litepicker({
element: document.getElementById('litepicker'),
elementEnd: document.getElementById('litepickerEnd'),
singleMode: false,
format: 'D MMMM, YYYY',
startDate: new Date(new Date().setDate(new Date().getDate() - 30)).toUTCString(),
endDate: new Date(),
minDate: new Date("January 1, 2020"),
maxDate: new Date(),
// selectBackward: true,
// dropdowns:{months: true},
numberOfMonths: 2,
numberOfColumns: 2,
// inlineMode: true,
useResetBtn: true,
autoApply: true,
});
/* chartSelected.addEventListener('change', () => {
if (chartSelected.value == "total") {
dataContent.label = 'Total Cases'
dataContent.backgroundColor = '#ff6384'
dataContent.hoverBackgroundColor = '#006400'
dataContent.data = state.confirmed
window.myBar.update()
console.log(dataContent)
} else if (chartSelected.value == "active") {
dataContent.label = 'Active Cases'
dataContent.backgroundColor = '#36a2eb'
dataContent.hoverBackgroundColor = '#ff6384'
dataContent.data = state.active
window.myBar.update()
console.log(dataContent)
} else if (chartSelected.value == "recovered") {
dataContent.label = 'Recovered Cases'
dataContent.backgroundColor = '#488f31'
dataContent.hoverBackgroundColor = '#006400'
dataContent.data = state.recovered
window.myBar.update()
console.log(dataContent)
} else {
dataContent.label = 'Deaths'
dataContent.backgroundColor = '#433A3F'
dataContent.data = state.dead
dataContent.hoverBackgroundColor = '#cecece'
window.myBar.update()
console.log(dataContent)
}
}) */
</script>
</body>
</html>