Skip to main content
Public

Share visualization

Loading preview…

Creating SVG 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

Creating SVG Scatter Plot

1
DDasbach.EJ
Last edited Apr 19, 2021
Created on Apr 18, 2021

This example demonstrates a dynamic SVG scatter plot built with D3 version 6, displaying randomly generated (x, y) data points as tan circles with varying radii and labeled coordinates. The visualization uses `d3.scaleLinear` for the x- and y-axes, `d3.scaleSqrt` for circle sizing, and `d3.axisBottom` and `d3.axisLeft` for the axes, all rendered through SVG elements appended to the body. The data array is created with a JavaScript loop and `Math.random`, with 20 points plotted across a full-window canvas, and each point includes a text label showing its coordinates.

AI-generated description

A demonstration of how to start using D3 version 6.

Comments

Sign in to join the discussion.

MIT Licensed