Skip to main content
100%

Customise Axis

✓ Published0🌍 Public
Kkrishv2
Last edited Jun 19, 2020
Created on Jun 19, 2020
Forked from Hello VizHub

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 description

Horizontal and verical bar charts

MIT Licensed

Similar vizzes