Skip to main content
Public

Share visualization

Loading preview…

D3 Scatter Plot (Vanilla JS)

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

D3 Scatter Plot (Vanilla JS)

5
AAndrea Mignone
Last edited May 6, 2021
Created on May 5, 2021

This example renders a scatter plot of iris flower measurements, mapping petal length to the x-axis and sepal length to the y-axis. It loads CSV data from a Gist URL using `d3.csv`, parses numeric fields, and applies `d3.scaleLinear` for both axes. Circles are appended to an SVG via `d3.select` and `join`, with axes generated by `d3.axisLeft` and `d3.axisBottom`. The chart fills the browser window, using a margin convention and D3 v6 with vanilla JavaScript.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed