.chart div {
font: 10px sans-serif;
background-color: steelblue;
text-align: right;
padding: 3px;
margin: 1px;
color: white;
}
</style>
<div class="chart"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script>
var data = [1.19209289551e-05, 3.70760703087, 0.162719964981, 0.159816026688, 0.159816026688, 6.00016117096];
var x = d3.scale.linear()
.domain([0, d3.max(data)])
.range([0, 1024]);
d3.select(".chart")
.selectAll("div")
.data(data)
.enter().append("div")
.style("width", function(d) { return x(d) + "px"; })
.text(function(d) { return d; });
</script>
I am looking to include additional descriptive text alongside each bar in the chart created by this code. How can I achieve that?
Thank you!