Skip to content
Snippets Groups Projects
Commit 368aa7d8 authored by rodpena's avatar rodpena
Browse files

listaJugadores

parent 96de26b2
No related branches found
No related tags found
No related merge requests found
...@@ -214,8 +214,32 @@ function crearGraficoRadar(containerSelector, jugadoresSeleccionados = [], maxim ...@@ -214,8 +214,32 @@ function crearGraficoRadar(containerSelector, jugadoresSeleccionados = [], maxim
.style("stroke", jugador.color) .style("stroke", jugador.color)
.style("stroke-width", 2); .style("stroke-width", 2);
}); });
// Añadir los nombres de los jugadores seleccionados con sus colores en la esquina superior derecha
const legendGroup = svg.append("g")
.attr("transform", `translate(${radius + margin}, ${-radius - margin})`)
.attr("class", "legend");
jugadoresSeleccionados.forEach((jugador, index) => {
const legendItem = legendGroup.append("g")
.attr("transform", `translate(0, ${index * 20})`);
// Círculo de color
legendItem.append("circle")
.attr("r", 8)
.attr("fill", jugador.color);
// Nombre del jugador
legendItem.append("text")
.attr("x", 15)
.attr("y", 4)
.style("font-size", "14px")
.style("fill", "#333")
.text(jugador.Nombre);
});
} }
function cargarJugadoresDesdeArchivo() { function cargarJugadoresDesdeArchivo() {
const csvPath = "assets/estadisticasRendimientoJugadores.csv"; const csvPath = "assets/estadisticasRendimientoJugadores.csv";
const ladoIzquierdo = d3.select("#lado-izquierdo"); const ladoIzquierdo = d3.select("#lado-izquierdo");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment