问题标签 [svg-marker]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
svg - How to place multiple evenly-spaced arrowheads along an SVG line?
I am new to SVG and I am trying to draw a straight line between two points. I managed so far by using this command:
<line x1="50" y1="50" x2="150" y2="150" style="stroke:rgb(255,255,0); stroke-width:2" stroke-dasharray="5,3" />"
What is the simplest way to add tiny triangles or arrow heads (evenly spaced) over this line in order to indicate the direction?
Edit 1:
Just to be more clear, I am not after an arrow at the end of the line, but multiple triangles (evenly spaced) along the whole line. If possible, I would like to replace each dash in the dashed line with a triangle pointing in the direction of the line.
Edit 2
Based on Phrogz' suggestion, I created a page as shown below, but nothing is showing up. What am I doing wrong?