Skip to content

Instantly share code, notes, and snippets.

@valegui
Last active December 18, 2016 02:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valegui/97248734019cdb9b1050043c2ae7f5fc to your computer and use it in GitHub Desktop.
Save valegui/97248734019cdb9b1050043c2ae7f5fc to your computer and use it in GitHub Desktop.
Total de encuestados que realizan trabajo doméstico
<!doctype html>
<meta charset="utf-8">
<script src="//d3plus.org/js/d3.js"></script>
<script src="//d3plus.org/js/d3plus.js"></script>
<div id="viz"></div>
<script>
var sample_data = [
{
"Sexo": "Hombre",
"Realiza.Trabajo": "Si",
"trabajo": 7847,
"Total": 16440,
"Porcentaje.del.total": 22.7,
"Porcentaje.del.sexo": 47.73
},
{
"Sexo": "Mujer",
"Realiza.Trabajo": "Si",
"trabajo": 11721,
"Total": 18135,
"Porcentaje.del.total": 33.9,
"Porcentaje.del.sexo": 64.63
},
{
"Sexo": "Hombre",
"Realiza.Trabajo": "No",
"trabajo": 8593,
"Total": 16440,
"Porcentaje.del.total": 24.9,
"Porcentaje.del.sexo": 52.27
},
{
"Sexo": "Mujer",
"Realiza.Trabajo": "No",
"trabajo": 6414,
"Total": 18135,
"Porcentaje.del.total": 18.6,
"Porcentaje.del.sexo": 35.37
}
]
var visualization = d3plus.viz()
.container("#viz")
.data(sample_data)
.type("tree_map")
.id(["Sexo","Realiza.Trabajo"])
.color("Sexo")
.legend({"size": 50, "labels": true, "data": false })
.depth(1)
.size("trabajo")
.draw()
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment