diff --git a/Js/script.js b/Js/script.js index 30d70ba04ac653cba0ee85b5dc659b2a201eda67..883ace8913c34a494e5e4363b6ffb9937c328ff4 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")