From 56a6cd55a5988173014e4c36c4c8cecc8e1e07e7 Mon Sep 17 00:00:00 2001 From: Alejolonber25 Date: Sat, 11 May 2024 21:12:11 -0500 Subject: [PATCH 1/4] WIP:BUILD: Cancelled requests added in statistics of quality --- .../static/js/statistics/leader_pie_chart.js | 11 ++++--- .../static/js/statistics/manager_pie_chart.js | 11 ++++--- .../components/pie_chart_leader_quality.html | 32 ++++++++++--------- .../components/pie_chart_manager_quality.html | 22 +++++++++---- .../statistical_registers/statistics.html | 13 +------- hiring_module/hiring_app/views/utilities.py | 27 ++++++++++------ 6 files changed, 64 insertions(+), 52 deletions(-) diff --git a/hiring_module/hiring_app/static/js/statistics/leader_pie_chart.js b/hiring_module/hiring_app/static/js/statistics/leader_pie_chart.js index 79cd487..df67470 100644 --- a/hiring_module/hiring_app/static/js/statistics/leader_pie_chart.js +++ b/hiring_module/hiring_app/static/js/statistics/leader_pie_chart.js @@ -2,7 +2,7 @@ var leaderChart; function createOrUpdateLeaderChart() { var chartCanvas = document.getElementById("leader_chart_pie"); - + // Eliminar el gráfico anterior si existe if (leaderChart) { leaderChart.destroy(); @@ -13,15 +13,16 @@ function createOrUpdateLeaderChart() { leaderChart = new Chart(ctx, { type: 'doughnut', data: { - labels: ["Solicitudes Aprobadas", "Solicitudes En revisión", "Solicitudes por validar"], + labels: ["Solicitudes Aprobadas", "Solicitudes En revisión", "Solicitudes por validar","Solicitudes canceladas"], datasets: [{ data: [ parseInt(document.getElementById("solicitudes_aprobadas_leader").innerText), parseInt(document.getElementById("solicitudes_en_revision_leader").innerText), - parseInt(document.getElementById("solicitudes_por_validar_leader").innerText) + parseInt(document.getElementById("solicitudes_por_validar_leader").innerText). + parseInt(document.getElementById("solicitudes_canceladas_leader").innerText) ], - backgroundColor: ['#1cc88a', '#f6c23e', '#e74a3b'], - hoverBackgroundColor: ['#188f64', '#c99f33', '#9d342a'], + backgroundColor: ['#1cc88a', '#f6c23e', '#e74a3b','#858795'], + hoverBackgroundColor: ['#188f64', '#c99f33', '#9d342a','#666873'], hoverBorderColor: "rgba(234, 236, 244, 1)", }], }, diff --git a/hiring_module/hiring_app/static/js/statistics/manager_pie_chart.js b/hiring_module/hiring_app/static/js/statistics/manager_pie_chart.js index 3b5e1bb..4ee5891 100644 --- a/hiring_module/hiring_app/static/js/statistics/manager_pie_chart.js +++ b/hiring_module/hiring_app/static/js/statistics/manager_pie_chart.js @@ -2,7 +2,7 @@ var managerChart; function createOrUpdateManagerChart() { var chartCanvas = document.getElementById("manager_chart_pie"); - + // Eliminar el gráfico anterior si existe if (managerChart) { managerChart.destroy(); @@ -13,15 +13,16 @@ function createOrUpdateManagerChart() { managerChart = new Chart(ctx, { type: 'doughnut', data: { - labels: ["Solicitudes Aprobadas", "Solicitudes En revisión", "Solicitudes por validar"], + labels: ["Solicitudes Aprobadas", "Solicitudes En revisión", "Solicitudes por validar", "Solicitudes canceladas"], datasets: [{ data: [ parseInt(document.getElementById("solicitudes_aprobadas_manager").innerText), parseInt(document.getElementById("solicitudes_en_revision_manager").innerText), - parseInt(document.getElementById("solicitudes_por_validar_manager").innerText) + parseInt(document.getElementById("solicitudes_por_validar_manager").innerText), + parseInt(document.getElementById("solicitudes_canceladas_manager").innerText) ], - backgroundColor: ['#1cc88a', '#f6c23e', '#e74a3b'], - hoverBackgroundColor: ['#188f64', '#c99f33', '#9d342a'], + backgroundColor: ['#1cc88a', '#f6c23e', '#e74a3b','#858795'], + hoverBackgroundColor: ['#188f64', '#c99f33', '#9d342a','#666873'], hoverBorderColor: "rgba(234, 236, 244, 1)", }], }, diff --git a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html index a75c6ec..9cbba64 100644 --- a/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html +++ b/hiring_module/hiring_app/templates/statistical_registers/components/pie_chart_leader_quality.html @@ -1,10 +1,9 @@ {% load static %}
-
- +