I am trying to make a progress bar using d3, I am able to make the bar chart
But I want to have the range overlap under the bar like this
Here is my d3 code
var my_values = [
{ name: 'London', cost: 8674000},
{ name: 'New York', cost: 8406000},
{ name: 'Sydney', cost: 4293000},
{ name: 'Paris', cost: 2244000},
{ name: 'Beijing', cost: 11510000}
];
d3.selectAll('rect')
.data(my_values)
.attr('height', 5)
.attr('width', function(d) {
var scaleFactor = 0.00004;
return d.cost * scaleFactor;
})
.attr('y', function(d, i) {
return i * 20;
})
Is there a way to make the range of the bar show under each rect so that the user can eye ball what is the relative percentage base on the position of the bar?
Edit:
I want to know how to create just the bar, here is the bar with text omitted

