Skip to main content
100%

Simple scatter plot in v4

✓ Published0🌍 Public
Dd3noob
Last edited Aug 14, 2016
Created on Aug 14, 2016

This example shows a simple line graph with circular data points overlaid to create a scatter plot, displaying stock closing prices over time. The visualization uses d3.csv to load the data, d3.timeParse to convert date strings, and d3.scaleTime and d3.scaleLinear to map the date and price values to pixel coordinates. A d3.line generator draws the line path, while appended circle elements mark each data point. The chart includes axes generated with d3.axisBottom and d3.axisLeft, all rendered as SVG within the page.

AI-generated description

This is a simple graph demonstrating the addition of dots suitable as a scatter plot 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.

Similar vizzes