I have a vertical-line which is drawn using d3
. Suppose I want to repeat the line for a several number of times like a bar code. How do I do it?
I know that it has to be done using for
but i don't have any clue on how to do it.
Suggestions will be very much helpful.
Here's the code:
var height = 500; var width = 500; var svgContianer = d3.select("body") .append("svg") .attr("width", width) .attr("height", height) var line = svgContianer.append("line") .attr("x1", 20) .attr("x2", 20) .attr("y1", 100) .attr("y2", 0) .attr("stroke", "#000") .attr("stroke-width", 2)
Thanks in advance.