Skip to main content
Public

Share visualization

Loading preview…

34. D3 Scatterplot Labels

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

34. D3 Scatterplot Labels

1
Aamakanju@nyit.edu
Last edited Feb 13, 2026
Created on Feb 9, 2026

This example shows a simple D3 scatterplot that displays each point’s coordinate values as red text labels directly beside the corresponding circles. The code uses a fixed dataset of ten [x, y] pairs and an SVG rendering approach, with d3.select and data joins to append both circle and text elements. The circles’ radii are calculated as the square root of the height minus the y-coordinate, while the labels reveal the raw data values in an 11-pixel sans-serif font. The visualization is static, with no animation or interactive behavior.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed