Skip to main content
100%

Simple graph with grid lines in v4

✓ Published0🌍 Public
Aalandunning
Last edited Oct 4, 2017
Created on Oct 4, 2017

A simple line graph displays six date–value pairs from a local CSV file, with light grey horizontal grid lines extending across the plot. The visualization uses d3.v4 with SVG rendering, employing `d3.scaleTime` for the x-axis and `d3.scaleLinear` for the y-axis. The grid is generated by `d3.axisLeft` with custom tick sizing, while the line is drawn via `d3.line`. Axes are added using `d3.axisBottom` and `d3.axisLeft`, with x-axis tick values explicitly set to the data dates.

AI-generated description

This is a simple graph demonstrating the addition of grid lines in conjunction with a line graph. This was written using d3.js v4 and is a follow on to the simple graph example here.

This graph is part of the code samples for the update to the book D3 Tips and Tricks to version 4 of d3.js.

forked from <a href='http://bl.ocks.org/d3noob/'>d3noob</a>'s block: <a href='http://bl.ocks.org/d3noob/c506ac45617cf9ed39337f99f8511218'>Simple graph with grid lines in v4</a>

forked from <a href='http://bl.ocks.org/anonymous/'>anonymous</a>'s block: <a href='http://bl.ocks.org/anonymous/11bd68cce12df5678b483e5c8bac30cd'>Simple graph with grid lines in v4</a>

mit Licensed

Similar vizzes