Skip to main content
100%

Customizing Axes

✓ Published1🌍 Public
Jjf1978
Last edited Jun 2, 2020
Created on Jun 2, 2020
Forked from Making a bar chart

The graphic compares the land sizes of Sweden, Greenland, and the US using horizontal bars, drawn as SVG rectangles scaled with d3.scaleBand for the categorical y-axis and d3.scaleLinear for the quantitative x-axis. The chart customizes both axes: the left axis has its domain and tick lines removed, while the bottom axis removes its domain line, adds gridlines via d3.axisBottom with d3.format(".1s") tick labels, and includes a manual "Population" label. Data is loaded from data.csv using d3.csv, and rendering is handled through d3.select and SVG element appends.

AI-generated description
MIT Licensed

Similar vizzes