-
Notifications
You must be signed in to change notification settings - Fork 0
/
pruebas.html
51 lines (48 loc) · 1.08 KB
/
pruebas.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ENIGH</title>
<script src="d3/d3.v3.js" type="text/javascript"></script>
</head>
<body>
<h1>Encuesta Nacional de Ingresos y Gastos de los Hogares</h1>
<!-- TODO: Task 1: Mostrar el CSV -->
<div id="container"></div>
<div id="svg">
<svg width="50" height="50">
<circle cx="25" cy="25" r="22" fill="blue" stroke="gray" stroke-width="2"/>
</svg>
</div>
<footer>
Fernando Aguilar
</footer>
<script type="text/javascript">
var data = [5, 10, 15, 20, 25];
d3.select("body")
.selectAll("p")
.data(data)
.enter()
.append("p")
.text(function(d) { return "I can count up to " +d; })
.style("color", function(d) {
if( d > 15) {
return "black";
}
else {
return "red";
}
})
.style("font-size", function(d) { return d + "px";});
function imprime(d)
{
if(d!=0) {
imprime(d-1);
var t = d3.select("footer").text();
d3.select("footer").text(t + ", " +d);
}
}
imprime(10);
</script>
</body>
</html>