If you're interested in showing data elements only when hovering over path/rect elements, consider adding titles directly to those elements during creation.
Here's an example:
var data = [0, 1, 2, 3, 4, 5],
size = 300;
var canvas = d3.select("body")
.append("svg:svg")
.attr("width", size)
.attr("height", size);
var pixels = size / data.length;
canvas.selectAll("rect").data(data).enter().append("svg:rect")
.attr("fill", "red")
.attr("height", function(d){return d * pixels})
.attr("width", pixels/2)
.attr("x", function(d,i){return i * pixels})
.attr("y", 0)
.append("title") //Adding the title element to the rectangles.
.text(function(d){return d});
This script will generate five rectangles with their respective data shown in a tooltip upon hovering over each rectangle.
I hope this solution is helpful.
Update based on feedback:
To convert a top-to-bottom graph into a bottom-to-top one, adjust the y attribute like this:
.attr("y", function(d){return size - d * pixels})
By adding this line, the bar will now start at the difference between the maximum height of your graph and the size of the bar, effectively transforming the graph from top-to-bottom to bottom-to-top.