I have a problem with my real-time chart. In this chart there is many rectangles with means chart.
I want to this rectangles have a drag and drop. Drag function:
function dragged(d) {
var xd = d3.event.x;
var yd = d3.event.y;
d3.select(this).select("text")
.attr("x", xd)
.attr("y", yd);
d3.select(this).select("rect")
.attr("x", xd)
.attr("y", yd - 20);
line = focus.select("line.bl").attr("x1", xd).attr("y1", yd)
}
But whichever I choose the rectangle, It will the first. I know what "select" choose only first element, but how can I select element, which I want?