Skip to main content
100%

自定义坐标轴

✓ Published1🌍 Public
HHillKinsh
Last edited Dec 19, 2020
Created on Dec 19, 2020
Forked from 大黄脸

This example shows horizontal bar charts ranking the top ten most populous countries, with a custom-styled axis and clear visual encoding of population size. Using d3.csv to load the data, it applies a linear scale for the x-axis and a band scale for the y-axis, with bars rendered as SVG rectangles. The code customizes the axes by removing default domain lines, adding a labeled axis title, and formatting tick labels with d3.format (converting values to billions). It also leverages d3.axisLeft and d3.axisBottom for tick generation and layout.

AI-generated description

A bare chart of d3js. HTML page demonstrating use of CSS and JavaScript

MIT Licensed

Similar vizzes