-
Notifications
You must be signed in to change notification settings - Fork 72
/
bar_charts.html
40 lines (30 loc) · 981 Bytes
/
bar_charts.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dataviz Exercise</title>
</head>
<body>
<h1>Dataviz Exercise</h1>
<h2>Bar Charts</h2>
<div id="bar-chart-container"></div>
<br>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script type="text/javascript">
console.log("MAKING SOME CHARTS...")
// SETUP
var barData = [
{"genre": "Thriller", "viewers": 123456},
{"genre": "Mystery", "viewers": 234567},
{"genre": "Sci-Fi", "viewers": 987654},
{"genre": "Fantasy", "viewers": 876543},
{"genre": "Documentary", "viewers": 283105},
{"genre": "Action", "viewers": 544099},
{"genre": "Romantic Comedy", "viewers": 121212}
] // leave this data as-is
// IMPLEMENTATION
console.log("BAR DATA", barData)
// todo: write some JavaScript here!
</script>
</body>
</html>