score:1

Fixed it , posting the fix for anyone who will have same issue:

for(let d of data){
  var line = svg.append("line")
             .attr("d", "line_path")
             .attr("x1",d.x1)  
             .attr("y1",d.y1)  
             .attr("x2",d.x2)  
             .attr("y2",d.y2)  
             .attr("stroke", d.arrowcolor)  
             .attr("stroke-width",2)  
             .attr("marker-end", markercolor(d.arrowcolor))
             .attr("rotate", d.rotation); 
  
  svg.append("text")
    .attr("dx", (d.x1 + d.x2)/2)
    .attr("dy", d.y1)
    .style("text-anchor", "middle")
    .text(d.label);
}


Related Query

More Query from same tag