Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- context.beginPath();
- // Make sure to start in the right place
- context.moveTo(0, canvas.height-elevations[i]);
- // Skip the first point, we already started there
- for (var i = 1; i < elevations.length; i++){
- //Plot the lines
- context.lineTo(i*canvas.width/elevations.length, canvas.height-elevations[i]);
- }
- // Move one pixel outside the right hand bottom corner of the cavas
- context.moveTo(canvas.width+1, canvas.height+1);
- // Move one pixel outside the left hand bottom corner of the canvas
- context.moveTo(-1, canvas.height+1);
- // Close the shape
- context.closePath();
- //Fill the shape
- context.fillStyle = "#F00";
- context.fill();
- alert("attempting to fill");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement