<html>
  <head>
    <script src="http://d3js.org/d3.v3.min.js"></script>
    <link href='https://fonts.googleapis.com/css?family=Roboto:400,100' rel='stylesheet' type='text/css'>
    <style>
      html {
        font-family: 'Roboto', sans-serif;
      }
      .chart div {
        font: 10px sans-serif;
        background-color: steelblue;
        text-align: right;
        padding: 3px;
        margin: 1px;
        color: white;
      }
    </style>
  </head>
  <body>
    <h1>Primer ejemplo con D3js</h1>
      <div class="chart">


      </div>
    <script type="text/javascript">
 
   

    var data = [4, 8, 15, 16, 23, 42];

     var x = d3.scale.linear()
    .domain([0, d3.max(data)])
    .range([0, 420]);


    d3.select(".chart")
        .selectAll("div")
          .data(data)
        .enter().append("div")
          //.style("width", function(d) { return x(d) * 10 + "px"; })
          .style("width", function(d) { return d * 10 + "px"; })
          .text(function(d) { return d; });

    </script>
  </body>
</html>

