mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: chart in page home
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
width: 420px;
|
||||
height: 420px;
|
||||
background-color: #2b376e;
|
||||
border-radius: 15px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
|
||||
text-align: center;
|
||||
line-height: 30px; /* Centraliza o texto verticalmente */
|
||||
@@ -46,10 +46,8 @@
|
||||
width: 95%;
|
||||
/* height: 80%; */
|
||||
background-color: #2b376e;
|
||||
border-radius: 15px;
|
||||
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
|
||||
text-align: center;
|
||||
line-height: 30px; /* Centraliza o texto verticalmente */
|
||||
line-height: 30px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
|
||||
console.log(document.getElementById('n-0'))
|
||||
|
||||
|
||||
var xValues = [document.getElementById('n-0').innerText,
|
||||
document.getElementById('n-1').innerText,
|
||||
document.getElementById('n-2').innerText,
|
||||
document.getElementById('n-3').innerText,
|
||||
document.getElementById('n-4').innerText
|
||||
];
|
||||
var yValues = [document.getElementById('q-0').innerText,
|
||||
document.getElementById('q-1').innerText,
|
||||
document.getElementById('q-2').innerText,
|
||||
document.getElementById('q-3').innerText,
|
||||
document.getElementById('q-4').innerText
|
||||
];
|
||||
var barColors = ["red", "green","blue","orange","brown"];
|
||||
|
||||
new Chart("vendas", {
|
||||
type: "bar",
|
||||
data: {
|
||||
labels: xValues,
|
||||
datasets: [{
|
||||
backgroundColor: barColors,
|
||||
data: yValues
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
legend: {display: false},
|
||||
title: {
|
||||
display: true,
|
||||
text: "Produtos mais vendidos"
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user