title: How to draw a line on a canvas using fabric.js
body: <p>I am using fabric.js to draw a line on a canvas. This is my code, but I'm not getting any output:</p>
  
  <pre><code>$("#Line").click(function() {
      // alert("Line");
      canvas.add(new fabric.Line([50, 100, 200, 200], {
          left: 170,
          top: 150,
          fill: 'red'
      }));
  });
  </code></pre>