feat: implement consistent 20-color mapping for visible products across dashboard charts
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m30s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m30s
This commit is contained in:
33
fake-data.cjs
Normal file
33
fake-data.cjs
Normal file
@@ -0,0 +1,33 @@
|
||||
const products = [];
|
||||
|
||||
// Group 1: High Quantity, Low Price (Top 10 in Bar Chart, won't show in Pie Chart)
|
||||
for (let i = 0; i < 10; i++) {
|
||||
products.push({
|
||||
Nome_Cliente: "Fake Client A" + i,
|
||||
Data_Pedido: "06-05-2026",
|
||||
Valor_Pedido: 100,
|
||||
ID_Produto: "QA" + i,
|
||||
Descricao_Produto: "Produto Muito Vendido " + i,
|
||||
Quantidade: 1000 + i, // High sales
|
||||
Valor_Unitario: 0.10 // Low revenue
|
||||
});
|
||||
}
|
||||
|
||||
// Group 2: Low Quantity, High Price (Top 10 in Pie Chart, won't show in Bar Chart)
|
||||
for (let i = 0; i < 10; i++) {
|
||||
products.push({
|
||||
Nome_Cliente: "Fake Client B" + i,
|
||||
Data_Pedido: "06-05-2026",
|
||||
Valor_Pedido: 10000,
|
||||
ID_Produto: "QB" + i,
|
||||
Descricao_Produto: "Produto Muito Caro " + i,
|
||||
Quantidade: 1, // Low sales
|
||||
Valor_Unitario: 10000 + i // High revenue
|
||||
});
|
||||
}
|
||||
|
||||
fetch('http://localhost:3004/api/data', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', 'x-api-key': 'nexstar_secret_key_123' },
|
||||
body: JSON.stringify(products)
|
||||
}).then(res => console.log("Status:", res.status)).catch(console.error);
|
||||
Reference in New Issue
Block a user