i can handle it like that ;
svg.selectAll("rect")
.data(zones)
.enter()
.append("rect")
.attr("id", function (d) { return "zone" + d.zone; })
.attr("class", "zone")
.attr("x", function (d, i) {
if (parseInt(i / (wcount)) % 2 == 0) {
this.xcor = (i % wcount) * zoneW;
}
else {
this.xcor = (zoneW * (wcount - 1)) - ((i % wcount) * zoneW);
}
return this.xcor;
})
and anymore you can find x coordinate
svg.select("#zone1").on("click",function(){alert(this.xcor});