From a5fbad1b231132fdd8f40f861c838367068bfd90 Mon Sep 17 00:00:00 2001
From: ferngon <fernando.gonzalez.sanz@alumnos.uva.es>
Date: Wed, 4 Dec 2024 17:14:05 +0000
Subject: [PATCH] Update file xg2.js

---
 xg2.js | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/xg2.js b/xg2.js
index 4783744..393719b 100644
--- a/xg2.js
+++ b/xg2.js
@@ -142,7 +142,21 @@
             .attr("font-size", "24px") // Tamaño mayor
             .attr("fill", "black") // Color del texto (negro)
             .text("Diferencia de xG (xG_diff)");
-    
+        
+            // Dibujar líneas desde el eje Y hasta el final del eje X
+        svg.selectAll(".team-line")
+            .data(filteredData)
+            .enter()
+            .append("line")
+            .attr("class", "team-line")
+            .attr("x1", 0) // Desde el inicio del eje X
+            .attr("y1", d => y(d.team) + y.bandwidth() / 2) // Centrado en la banda del equipo
+            .attr("x2", width) // Hasta el final del eje X
+            .attr("y2", d => y(d.team) + y.bandwidth() / 2) // Mantener alineación
+            .attr("stroke", "lightgray") // Color de la línea
+            .attr("stroke-width", 1) // Grosor de la línea
+            .attr("stroke-dasharray", "4,2"); // Línea punteada
+
         // Añadir el texto sobre el fondo
         svg.append("text")
             .attr("transform", "rotate(-90)") // Rota el texto
-- 
GitLab