Skip to main content
100%

Customizing Axis

✓ Published2🌍 Public
RRonie Uliana
Last edited Jun 5, 2020
Created on Jun 3, 2020
Forked from Making a bar chart

This example demonstrates how to customize axes in a D3.js bar chart, showing the top 10 most populous countries. The horizontal axis uses a linear scale with a custom tick format that abbreviates numbers (e.g., "1.4B" for billions), while the vertical band scale lists country names. The code imports specific D3 v5 functions like `scaleLinear`, `scaleBand`, `axisBottom`, and `axisLeft`, and removes default axis lines and ticks for a cleaner look. The chart renders as SVG, with data loaded from a CSV file and styled via CSS classes for tick labels, axis titles, and the chart heading.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes