Skip to main content
Public

Share visualization

Loading preview…

Creating a Scatter Plot with D3.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

Creating a Scatter Plot with D3.js

0
SsreepavanKothapalli
Last edited Mar 23, 2023
Created on Mar 22, 2023

This example visualizes the Iris flower dataset as a scatter plot, showing the relationship between petal length and petal width. Each circle represents a flower, colored by its species (blue, grey, or brown) using a custom marker function. The code loads CSV data with D3’s `csv` method, scales values with `scaleLinear` and `extent`, and renders axes via `axisLeft` and `axisBottom`. Circles are appended to an SVG using `select`, `data`, and `join`, with styling applied through `attr` properties.

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