Customising Axes
✓ Published1🌍 Public
This example shows a horizontal bar chart ranking the world’s most populous countries, with custom styling for both axes. The chart uses D3’s `scaleBand` and `scaleLinear` to map country names and population values to screen coordinates, while `axisBottom` and `axisLeft` produce the ticks and grid lines. The y-axis’s default domain and tick lines are removed, and the x-axis labels are formatted using `format('.3s')` to abbreviate large numbers (e.g., converting G to B). The bars themselves are purple SVG rectangles, and the data comes from a CSV file listing population figures.
AI-generated descriptionThis bar chart data comes from (https://datahub.io/JohnSnowLabs/population-figures-by-country#resource-population-figures-by-country-csv).
MIT Licensed