Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. context.beginPath();
  2. // Make sure to start in the right place
  3. context.moveTo(0, canvas.height-elevations[i]);
  4. // Skip the first point, we already started there
  5. for (var i = 1; i < elevations.length; i++){
  6.     //Plot the lines
  7.     context.lineTo(i*canvas.width/elevations.length, canvas.height-elevations[i]);
  8. }
  9. // Move one pixel outside the right hand bottom corner of the cavas
  10. context.moveTo(canvas.width+1, canvas.height+1);
  11. // Move one pixel outside the left hand bottom corner of the canvas
  12. context.moveTo(-1, canvas.height+1);
  13. // Close the shape
  14. context.closePath();
  15. //Fill the shape
  16. context.fillStyle = "#F00";
  17. context.fill();
  18. alert("attempting to fill");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement