title: How to draw border around canvas
body: <p>I am drawing an image on a canvas with white background color. I want to draw a border around the canvas and I am unable to do so. Here is my code:</p>
  
  <pre><code>canvas.width = image.width;
  canvas.height = image.height;
  var context = canvas.getContext('2d');
  context.fillStyle = "black";
  context.font = "50px Arial";
  context.fillText(chartId, 0, 50);
  context.drawImage(image, 0, 0);
  context.globalCompositeOperation = "destination-over";
  context.fillStyle = "#FFFFFF";
  context.fillRect(0,0,canvas.width,canvas.height);//for white background
  </code></pre>
  
  <p>after this i want a red border to appear around the whole canvas.</p>