Skip to content
Snippets Groups Projects
Commit a5fbad1b authored by ferngon's avatar ferngon
Browse files

Update file xg2.js

parent cabf0059
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
...@@ -143,6 +143,20 @@ ...@@ -143,6 +143,20 @@
.attr("fill", "black") // Color del texto (negro) .attr("fill", "black") // Color del texto (negro)
.text("Diferencia de xG (xG_diff)"); .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 // Añadir el texto sobre el fondo
svg.append("text") svg.append("text")
.attr("transform", "rotate(-90)") // Rota el texto .attr("transform", "rotate(-90)") // Rota el texto
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment