Skip to main content
100%

D3 Example

✓ Published0🌍 Public
CCurran Kelleher
Last edited Nov 17, 2015
Created on Nov 17, 2015

This D3 example displays a bar chart of the top five countries sorted by population, using data from a CSV file. It shows the relative population sizes of China, India, the USA, Indonesia, and Brazil on the y-axis, with country names on the x-axis. The visualization uses D3’s `d3.svg.axis` for axes and ordinal and linear scales for positioning. The y-axis labels are formatted with a custom SI tick format that abbreviates billions as "B". The chart is rendered as an SVG with margins and a bar padding, using a static bar width from `xScale.rangeBand()`.

AI-generated description

Top 5 countries, sorted by population. Example 6 from the screencast Splitting Charts.

MIT License

<!-- Start of SimpleHitCounter Code --> <div align="center"><a href="http://www.simplehitcounter.com" target="_blank"><img src="http://simplehitcounter.com/hit.php?uid=1978100&f=16777215&b=0" border="0" height="18" width="83" alt="web counter"></a></div> <!-- End of SimpleHitCounter Code -->

Similar vizzes