-
Notifications
You must be signed in to change notification settings - Fork 0
/
Insights.html
288 lines (257 loc) · 8.33 KB
/
Insights.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<html>
<head>
<link rel="stylesheet" type="text/css" href="insights.css">
<link rel="stylesheet" type="text/css" href="bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="cart.css">
<link rel="stylesheet" type="text/css" href="navigation.css">
<script type="text/javascript" src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
</head>
<img src="https://i.ibb.co/1mq2mfc/Logo.png" height="100px" class="center" margin-top="15px">
<div>
</div>
<body>
<div id="navigation"> </div>
<hr>
<div class="greenBucksInsights">
<h4 class="h4Insights"> Green Rating </h4>
<span class="greenScoreDiv badge badge-success cartScoreText"> 770 / 1000</span>
<h4 class="addMTop"> You're a deep green shopper! </h4>
</div>
<div class="greenBucksInsights">
<h4> You have earned </h4>
<span class="greenScoreDiv badge badge-success cartScoreText"> $75 </span>
<h4 class="addMTop"> Green Bucks </h4>
</div>
<hr>
<div id="chartContainer3" style="width: 50%; height: 300px; display:block;"></div> <br />
<hr>
<div id="chartContainer2" style="width: 50%; height: 300px;"></div><br />
<hr>
<div id="chartContainer1" style="width: 50%; height: 300px;"></div><br />
<hr>
<div id="chartContainer4" style="width: 50%; height: 300px;"></div><br />
<hr>
<div id="chartContainer5" style="width: 50%; height: 300px;"></div><br />
<hr>
<script type="text/javascript" src="navigation.js"></script>
</body>
<script>
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer1", {
animationEnabled: true,
title: {
text: "Green vs. Actual Monthly Consumption",
fontFamily: "Montserrat",
},
axisY: {
includeZero: false,
prefix: "$"
},
toolTip: {
shared: true
},
legend: {
fontSize: 13
},
data: [{
type: "spline",
showInLegend: true,
name: "Green Bucks",
horizontalAlign: "right",
yValueFormatString: "$#,##0",
xValueFormatString: "MMM YYYY",
dataPoints: [
{ x: new Date(2019, 2), y: 30 },
{ x: new Date(2019, 3), y: 35 },
{ x: new Date(2019, 4), y: 30 },
{ x: new Date(2019, 5), y: 75 },
{ x: new Date(2019, 6), y: 60 },
{ x: new Date(2019, 7), y: 37 },
{ x: new Date(2019, 8), y: 45 },
{ x: new Date(2019, 9), y: 67 },
{ x: new Date(2019, 10), y: 75 },
{ x: new Date(2019, 11), y: 38 },
{ x: new Date(2020, 0), y: 47 },
{ x: new Date(2020, 1), y: 75 }
]
},
{
type: "spline",
showInLegend: true,
yValueFormatString: "$#,##0",
name: "Dollars($)",
dataPoints: [
{ x: new Date(2019, 2), y: 65 },
{ x: new Date(2019, 3), y: 48 },
{ x: new Date(2019, 4), y: 35 },
{ x: new Date(2019, 5), y: 89 },
{ x: new Date(2019, 6), y: 101 },
{ x: new Date(2019, 7), y: 200 },
{ x: new Date(2019, 8), y: 52 },
{ x: new Date(2019, 9), y: 135 },
{ x: new Date(2019, 10), y: 163 },
{ x: new Date(2019, 11), y: 98 },
{ x: new Date(2020, 0), y: 127 },
{ x: new Date(2020, 1), y: 135 }
]
}]
});
chart.render();
}
var chart = new CanvasJS.Chart("chartContainer2",
{
animationEnabled: true,
title: {
text: "($) Spending by Category",
fontFamily: "Montserrat",
},
data: [
{
type: "pie",
showInLegend: true,
dataPoints: [
{ y: 21, legendText: "Electronics", indexLabel: "Electronics" },
{ y: 11, legendText: "Food", indexLabel: "Food" },
{ y: 9, legendText: "Safety/Hygiene", indexLabel: "Safety/Hygiene" },
{ y: 11, legendText: "Home & Garden", indexLabel: "Home & Garden" },
{ y: 10, legendText: "Pet Supplies", indexLabel: "Pet Supplies" },
{ y: 24, legendText: "Outdoor", indexLabel: "Outdoor" },
{ y: 14, legendText: "Office Products", indexLabel: "Office Products" }
]
},
]
});
chart.render();
var chart = new CanvasJS.Chart("chartContainer3",
{
title:{
text: "Green Rating Over Time",
fontFamily: "Montserrat",
},
data: [
{
type: "line",
showInLegend: true,
name: "GreenRating",
dataPoints: [
{ x: new Date(2019, 2), y: 0 },
{ x: new Date(2019, 3), y: 100 },
{ x: new Date(2019, 4), y: 153 },
{ x: new Date(2019, 5), y: 170 },
{ x: new Date(2019, 6), y: 265 },
{ x: new Date(2019, 7), y: 200 },
{ x: new Date(2019, 8), y: 377 },
{ x: new Date(2019, 9), y: 302 },
{ x: new Date(2019, 10), y: 376 },
{ x: new Date(2019, 11), y: 400 },
{ x: new Date(2020, 0), y: 388 },
{ x: new Date(2020, 1), y: 770 }
]
},
]
});
chart.render();
var chart = new CanvasJS.Chart("chartContainer4",
{
title: {
text: "Eco-Labels of Most Commonly Purchased Products",
fontFamily: "Montserrat",
},
legend: {
verticalAlign: "bottom",
horizontalAlign: "center"
},
data: [
{
//startAngle: 45,
indexLabelFontSize: 20,
indexLabelFontFamily: "Serif",
indexLabelFontColor: "black",
indexLabelLineColor: "black",
indexLabelPlacement: "outside",
type: "doughnut",
showInLegend: true,
dataPoints: [
{ y: 53.37, legendText: "4C Association 53%", indexLabel: "4C Association 53%" },
{ y: 35.0, legendText: "AENOR Medio Ambiente 35%", indexLabel: "AENOR Medio Ambiente 35%" },
{ y: 7, legendText: "Bay Area Green Business 7%", indexLabel: "Bay Area Green Business 7%" },
{ y: 2, legendText: "Better Cotton Initiative 2%", indexLabel: "Better Cotton Initiative 2%" },
{ y: 5, legendText: "BIO Hellas 5%", indexLabel: "BIO Hellas 5%" }
]
}
]
});
chart.render();
var chart = new CanvasJS.Chart("chartContainer5", {
animationEnabled: true});
var chart = new CanvasJS.Chart("chartContainer5", {
animationEnabled: true,
title:{
text:"Green Scores For Recently Purchased Products",
fontFamily: "Montserrat",
},
axisX:{
interval: 1
},
axisY2:{
interlacedColor: "rgba(1,77,101,.2)",
gridColor: "rgba(1,77,101,.1)",
title: "Green Score"
},
data: [{
type: "bar",
name: "companies",
axisYType: "secondary",
color: "#014D65",
dataPoints: [
{ y: 17, label: "TaoTronics Active Noise Canceling Headphones" },
{ y: 22, label: "Fire 7 Tablet" },
{ y: 28, label: "Fire TV Stick" },
{ y: 18, label: "Nikon COOLPIX B500" },
{ y: 25, label: "Logitech G633 Spectrum" },
{ y: 32, label: "Royalex Emulsion Semigloss" },
{ y: 44, label: "Softone White Roll Towel" },
{ y: 21, label: "3M™ Red Buffer Pad 5100" },
{ y: 11, label: "Excelsior Adhesive" },
{ y: 16, label: "9 Round Plate" }
]
}]
})
chart.render();
// Get the modal
var modal = document.getElementById("myModal");
// Get the button that opens the modal
var btn = document.getElementById("myBtn");
// Get the <span> element that closes the modal
// When the user clicks on the button, open the modal
btn.onclick = function () {
modal.style.display = "block";
}
// When the user clicks on <span> (x), close the modal
span.onclick = function () {
modal.style.display = "none";
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function (event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
</script>
<div>
</div>
<div>
</div>
<script>
const gra = function(min, max) {
return Math.random() * (max - min) + min;
}
const init = function(){
let items = document.querySelectorAll('section');
for (let i = 0; i < items.length; i++){
items[i].style.background = randomColor({luminosity: 'light'});
}
cssScrollSnapPolyfill()
}
</script>
</html>