Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVG connect two points with a line

Is there any way to connect two point using a line in SVG .I am having the following to create point in SVG.

<?xml version="1.0" standalone="no"?>

<svg width="200px" height="200px" version="1.1" xmlns="http://www.w3.org/2000/svg">

  <path d="M10 10"/>

  <!-- Points -->

  <circle cx="10" cy="10" r="2" fill="red"/>
  <circle cx="90" cy="90" r="2" fill="red"/>
  <circle cx="90" cy="10" r="2" fill="red"/>
  <circle cx="10" cy="90" r="2" fill="red"/>

</svg>

I need to draw a line between points using jquery functions.

like image 217
ashu Avatar asked Jan 13 '23 02:01

ashu


1 Answers

You can use a line:

<line x1="10" y1="10" x2="90" y2="90" stroke-width="1" stroke="black"/>

Or a path:

<path d="M10 10 90 90" stroke-width="1" stroke="black"/>

Why do you need jQuery?

like image 145
Peter Collingridge Avatar answered Jan 18 '23 16:01

Peter Collingridge