d3.js - Having issue with translate function -


i have coordinatesx , coordinatesy arrays. example if want draw arc between coordinatesx[1] , coordinatesy[4], part of code goes :

svg.append("path")

    .attr("d", arc)     .attr("fill", "red")     .attr("transform", "translate(coordinatesx[1],coordinatesy[4])"); 

i having problem translate function. says :

error: invalid value attribute transform="translate(coordinatesx[1],coordinatesy[4])"

how can overcome problem?

thanks in advance.

it has single string. salvador pointed out in comments, in example using coordinatesx[1] etc literally. but, if concatenate, javascript creates single string (if add number string, result string). in case:

.attr("transform", "translate(" + coordinatesx[1] + "," + coordinatesy[4]) + ")"); 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -