Skip to content

Commit 367a125

Browse files
committed
Merge branch 'Graph-Background'
2 parents 6a24435 + 09fff1a commit 367a125

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

js/grapher.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -605,14 +605,14 @@ function FlightLogGrapher(flightLog, graphConfig, canvas, craftCanvas, analyserC
605605

606606
//Draw an background for the line for a graph (at the origin and spanning the window)
607607
function drawAxisBackground(plotHeight) {
608-
canvasContext.strokeStyle = "rgba(255,255,255,0.1)";
609-
canvasContext.lineWidth = plotHeight;
610-
611-
canvasContext.beginPath();
612-
canvasContext.moveTo(0, 0);
613-
canvasContext.lineTo(canvas.width, 0);
614-
615-
canvasContext.stroke();
608+
var axisGradient = canvasContext.createLinearGradient(0,-plotHeight/2,0,plotHeight/2);
609+
axisGradient.addColorStop(0.0, 'rgba(255,255,255,0.1)');
610+
axisGradient.addColorStop(0.15, 'rgba(0,0,0,0)');
611+
axisGradient.addColorStop(0.5, 'rgba(0,0,0,0)');
612+
axisGradient.addColorStop(0.85, 'rgba(0,0,0,0)');
613+
axisGradient.addColorStop(1.0, 'rgba(255,255,255,0.1)');
614+
canvasContext.fillStyle = axisGradient;
615+
canvasContext.fillRect(0,-plotHeight/2,canvas.width, plotHeight);
616616
}
617617

618618
//Draw a grid

0 commit comments

Comments
 (0)