Skip to main content
Public

Share visualization

Loading preview…

48. D3 Axes Format

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

48. D3 Axes Format

0 stars1Public
Aamakanju@nyit.edu
Last edited Feb 26, 2026
Created on Feb 9, 2026

This example demonstrates how to format axis tick labels as percentages in an SVG scatterplot using D3.js version 4.5.0. The code creates random data points, scales them with `d3.scaleLinear` and `d3.scaleSqrt`, and applies a custom percentage format via `d3.format(".1%")` to both the bottom and left axes using `d3.axisBottom` and `d3.axisLeft`. The axes are rendered as SVG groups, with circles representing the data.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed