From 5e77b4c4aeebe485d8cac75f4e36edacdec190f6 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sun, 31 Dec 2017 14:35:19 +0100 Subject: [PATCH] Avoid cutoff above and below graph area --- js/diagrams.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/diagrams.js b/js/diagrams.js index 4210fff..af9dd7d 100644 --- a/js/diagrams.js +++ b/js/diagrams.js @@ -92,7 +92,9 @@ function createLineGraph(containerId, raceData){ .attr("id", "clip") .append("rect") .attr("width", graphPosWidth.width) - .attr("height", graphPosWidth.height); + .attr("height", graphPosWidth.height + 16) // Add 16 pixels of height ... + .attr("transform", "translate(0,-8)"); // ... so we can have 8 pixels above and below the graph + // This way, the lines and dots are not cut off var focus = svg.append("g") .attr("class", "focus")