Skip to content

Commit

Permalink
Merge branch 'Graph-Background'
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryKeeble committed Oct 16, 2016
2 parents 6a24435 + 09fff1a commit 367a125
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions js/grapher.js
Expand Up @@ -605,14 +605,14 @@ function FlightLogGrapher(flightLog, graphConfig, canvas, craftCanvas, analyserC

//Draw an background for the line for a graph (at the origin and spanning the window)
function drawAxisBackground(plotHeight) {
canvasContext.strokeStyle = "rgba(255,255,255,0.1)";
canvasContext.lineWidth = plotHeight;

canvasContext.beginPath();
canvasContext.moveTo(0, 0);
canvasContext.lineTo(canvas.width, 0);

canvasContext.stroke();
var axisGradient = canvasContext.createLinearGradient(0,-plotHeight/2,0,plotHeight/2);
axisGradient.addColorStop(0.0, 'rgba(255,255,255,0.1)');
axisGradient.addColorStop(0.15, 'rgba(0,0,0,0)');
axisGradient.addColorStop(0.5, 'rgba(0,0,0,0)');
axisGradient.addColorStop(0.85, 'rgba(0,0,0,0)');
axisGradient.addColorStop(1.0, 'rgba(255,255,255,0.1)');
canvasContext.fillStyle = axisGradient;
canvasContext.fillRect(0,-plotHeight/2,canvas.width, plotHeight);
}

//Draw a grid
Expand Down

0 comments on commit 367a125

Please sign in to comment.