-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaisvendidos.html
210 lines (190 loc) · 6.3 KB
/
maisvendidos.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
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mais Vendidos</title>
<link rel="icon" href="assets/images/Bookshelf Icon.png" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.0/chart.min.js"></script>
<style>
body {
font-family: 'Arial', sans-serif;
background-color: #E3E6E6;
margin: 0;
padding: 0;
text-align: center;
overflow-x: hidden;
}
.header {
width: 100%;
height: 100px;
background-color: rgba(59, 65, 218, 0.9);
color: white;
padding: 10px;
text-align: center;
}
.header h1 {
margin-top: 20px;
}
.header .links a {
color: white;
margin: 0 10px;
text-decoration: none;
margin-top: 20px;
}
.header .links a:hover {
text-decoration: underline;
}
.titulo {
margin-top: 0;
font-size: 24px;
}
main {
margin: 20px auto;
max-width: 800px;
padding-bottom: 20px;
}
canvas {
display: block;
margin: 0 auto;
max-width: 100%;
height: auto;
}
</style>
</head>
<body>
<header id="header" class="header">
<h1 onclick="window.location.href='index.html';">BookStore</h1>
<div class="links">
<a href="#" onclick="window.location.href='catalogo.html';">Catálogo</a>
<a href="#" onclick="window.location.href='maisvendidos.html';">Mais Vendidos</a>
<a href="#" onclick="window.location.href='recomendacao.html';">Recomendação</a>
<a href="#" onclick="window.location.href='sobrenos.html';">Sobre Nós</a>
<a href="#" onclick="window.location.href='contato.html';">Contato</a>
</div>
</header>
<main>
<canvas id="grafico-coluna" width="800" height="300"></canvas>
</main>
<script>
var ctx = document.getElementById("grafico-coluna").getContext("2d");
var chartGraph = new Chart(ctx, {
type: "bar",
data: {
labels: [
"Harry Potter", "Diario de um banana", "1808", "O Pequeno Príncipe",
"O Senhor dos Anéis", "Orgulho e Preconceito", "Dom Quixote","MARVEL",
],
datasets: [
{
label: "Vendas",
data: [30, 25, 6, 2, 15, 12, 8, 18],
backgroundColor: "#0734fbb7",
borderColor: "#0734fbb7",
borderWidth: 6,
fill: false,
},
],
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: 'Mais Vendidos nos Últimos 6 Meses',
font: {
size: 18,
weight: 'bold'
},
color: '#333'
},
legend: {
display: true,
position: 'top',
labels: {
font: {
size: 16,
weight: 'bold'
},
color: '#000',
}
},
tooltip: {
bodyFont: {
size: 14
},
bodyColor: '#fff'
},
}
}
});
</script>
<br>
<h1 class="titulo">Gêneros mais Pedidos</h1>
<main>
<canvas id="grafico-pizza" width="800" height="300"></canvas>
</main>
<script>
var ctx = document.getElementById("grafico-pizza").getContext("2d");
var chartGraph = new Chart(ctx, {
type: "pie",
data: {
labels: [
"História", "Romance", "Terror"
],
datasets: [{
label: "Pedidos de Livros",
data: [5, 10, 5],
backgroundColor: [
'rgba(255, 99, 132, 0.7)',
'rgba(54, 162, 235, 0.7)',
'rgba(255, 206, 86, 0.7)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)'
],
borderWidth: 3,
hoverOffset: 10
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: 'Distribuição de Pedidos de Livros por Gênero',
font: {
size: 18,
weight: 'bold'
},
color: '#333'
},
legend: {
display: true,
position: 'top',
labels: {
font: {
size: 16,
weight: 'bold'
},
color: '#000',
}
},
tooltip: {
backgroundColor: 'rgba(0, 0, 0, 0.7)',
bodyFont: {
size: 14
},
bodyColor: '#fff'
}
}
}
});
</script>
</body>
</h2>
</html>