🌍 Public
customizing axis
This example displays a horizontal bar chart of the top 10 most populous countries, with population values on the x-axis and country names on the y-axis. Using D3.v7, the code loads data from a CSV file and scales it by 1,000. It customizes the axes by removing the y-axis domain and tick lines, applying a custom tick formatter that converts values from G to B (billions), and styling grid lines and axis labels via CSS. The chart is rendered as SVG within a React-like setup, though the implementation uses direct DOM selection and appending.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
This bar chart shows population of the top 20 most populous countries
MIT Licensed
Comments
Sign in to join the discussion.