I’d like to use JavaScript to determine the length, slope, and other measurements of an existing SVG line segment (in screen pixels). I’ve been trying to use the jquery-svg plugin, but haven’t had any luck. Any suggestions?
I’d like to use JavaScript to determine the length, slope, and other measurements of
Share
With more searching, I found some JavaScript methods that should do the job:
getTotalLength()
document.getElementById("segment-line-c2200").getTotalLength()returns 205.11094665527344
getBBox()
document.getElementById("segment-line-c2200").getBBox()returns