From 9da047369dd4cfa7441d838d5f2cc781c9d1d869 Mon Sep 17 00:00:00 2001 From: frajuar <franciscojavier.juarez@estudiantes.uva.es> Date: Mon, 2 Dec 2024 13:40:48 +0100 Subject: [PATCH] cursor y eje y del grafico --- Js/script.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Js/script.js b/Js/script.js index 30d70ba..883ace8 100644 --- a/Js/script.js +++ b/Js/script.js @@ -114,11 +114,9 @@ function dibujaMapa(seleccionAnno) { .style("stroke","black") .on("mouseover",function(event,d){ const centroid = path.centroid(d); - const value = d.properties.value.toFixed(2).toString(); - const countryName = d.properties.name; - console.log(value); d3.select(this) .raise() + .style("cursor", "pointer") .style("stroke-width", 0.75) .attr("transform", ` translate(${centroid[0]}, ${centroid[1]}) @@ -264,8 +262,7 @@ function dibujaGrafico(country,paises){ // Animación para la lÃnea const totalLength = path.node().getTotalLength(); - path - .attr("stroke-dasharray", totalLength + " " + totalLength) + path.attr("stroke-dasharray", totalLength + " " + totalLength) .attr("stroke-dashoffset", totalLength) .transition() .duration(3000) @@ -290,9 +287,10 @@ function dibujaGrafico(country,paises){ .call(d3.axisLeft(yScale)); svg.append("text") + .style("font-size", "15px") .attr("text-anchor", "middle") - .attr("transform", `rotate(-90) translate(${-height / 2},${-margin.left + 10})`) - .text("Valor"); + .attr("transform", `translate(${-margin.left +35},${height / 2 -60})`) + .text("Valor PIB"); // TÃtulo svg.append("text") -- GitLab