Customise Axis
✓ Published0🌍 Public
This example displays population data for ten countries using both horizontal and vertical bar charts. The horizontal chart shows countries on the y-axis and population on the x-axis, while the vertical chart reverses these roles. Using d3.scaleLinear, d3.scaleBand, and d3.axisBottom/axisLeft, the code renders SVG rectangles styled in steelblue and red, with population values formatted using d3.format. The data is loaded from a CSV file and multiplied by 1000 before rendering.
AI-generated descriptionHorizontal and verical bar charts
MIT Licensed