34. D3 Scatterplot Labels
✓ Published1🌍 Public
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 descriptionMIT Licensed