Add very subtle grid lines on x axis

This commit is contained in:
Jan Philipp Timme 2017-12-30 13:26:15 +01:00
parent db72436ba6
commit a0d405c710
1 changed files with 11 additions and 0 deletions

View File

@ -188,6 +188,17 @@ function createLineGraph(containerId, raceData){
}) })
); );
// Add gridlines on x axis to better figure out laps
svg.append("g")
.attr("class", "grid")
.attr("transform", "translate(0," + height + ")")
.style("opacity", 0.06)
.call(d3.axisBottom(x)
.ticks(raceData.lapTimes.size) // One gridline for each lap
.tickSize(-height)
.tickFormat("")
);
svg.append("g") svg.append("g")
.call( .call(
d3.axisRight(y) d3.axisRight(y)