Skip to main content
Public

Share visualization

Loading preview…

Customizing Axes

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

Customizing Axes

1
YYifei Liu
Last edited Aug 27, 2020
Created on Aug 27, 2020
Forked from Making a bar chart

This example shows a horizontal bar chart of the top 10 most populous countries, using population data from the World Bank. It demonstrates customizing D3 axes by removing the default domain lines and gridlines, formatting tick labels to abbreviate large numbers (e.g., "G" to "B"), and adding custom axis titles and a data source citation. The code uses `d3.csv`, `d3.scaleLinear`, `d3.scaleBand`, `d3.axisBottom`, and `d3.axisLeft` to render the SVG chart.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed