-
Notifications
You must be signed in to change notification settings - Fork 0
/
instore.html
89 lines (84 loc) · 2.53 KB
/
instore.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
<!doctype html>
<html>
<!-- must include MIT license; source: http://www.chartjs.org/docs/latest/getting-started/ -->
<head>
<title>In-Store Black Friday Spending</title>
<script src="./utils.js"></script>
<style>
canvas{
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.bundle.min.js"></script>
</head>
<body>
<div style="width:75%;">
<canvas id="canvas"></canvas>
</div>
<script>
var MONTHS = ["2010", "2011", "2012", "2013", "2014", "2015"];
var config = {
type: 'line',
data: {
labels: ["2010", "2011", "2012", "2013", "2014", "2015"],
datasets: [{
label: "In-Store Spending",
backgroundColor: window.chartColors.purple,
borderColor: window.chartColors.purple,
data: [
50.372,
52.4,
59.1,
57.4,
50.9,
67.56
],
fill: false,
}]
},
options: {
responsive: true,
title:{
display:true,
text:'Black Friday Shopping'
},
tooltips: {
mode: 'index',
intersect: false,
},
hover: {
mode: 'nearest',
intersect: true
},
scales: {
xAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Year'
}
}],
yAxes: [{
display: true,
scaleLabel: {
display: true,
labelString: 'Dollars (Billions)'
},
ticks: {
beginAtZero: true,
min: 50,
max: 70,
}
}]
}
}
};
window.onload = function() {
var ctx = document.getElementById("canvas").getContext("2d");
window.myLine = new Chart(ctx, config);
};
</script>
</body>
</html>