diff --git a/backend/public/js/costs.js b/backend/public/js/costs.js index 0658743..aa15e88 100644 --- a/backend/public/js/costs.js +++ b/backend/public/js/costs.js @@ -81,9 +81,11 @@ function renderCostChart(serverParts, domainYear, total){ return } + const sortedParts = [...parts].sort((a, b) => b.amount - a.amount) + container.innerHTML = `
- ${parts.map((part, index) => ` + ${sortedParts.map(part => `
@@ -91,9 +93,8 @@ function renderCostChart(serverParts, domainYear, total){ `).join("")}
- ${parts - .sort((a, b) => b.amount - a.amount) - .map((part, index) => ` + ${sortedParts + .map(part => `
${part.label}