Skip to main content
Public

Share visualization

Loading preview…

Reusable D3 Scatter Plot

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

Reusable D3 Scatter Plot

1
UUzoemeka Okechukwu Innocent
Last edited Aug 23, 2023
Created on Aug 23, 2023

This example demonstrates a reusable D3 scatter plot using the Iris dataset, visualizing petal length against sepal length with circular marks. The code, written by InnocentSky and rendered as SVG, uses `d3.scaleLinear` for axes, `d3.axisLeft` and `d3.axisBottom` for ticks, and a configurable `scatterPlot()` factory function that accepts setters for width, height, data, margin, and radius. Data is loaded asynchronously via `d3.csv`, with numeric parsing applied to all measurement columns. The plot fills the browser window and includes styled tick labels.

AI-generated description

D3 Scatter Plot

Venilla Html Javascript D3 Scatter Plot

Comments

Sign in to join the discussion.

MIT Licensed