Skip to main content
100%

D3 Course 1: Bar Chart

✓ Published1🌍 Public
VVikas Pathak
Last edited Apr 4, 2020
Created on Apr 4, 2020

This bar chart displays the population of ten countries, using horizontal bars sorted alphabetically by country name. The visualization is built with D3 v5, loading data from a CSV file and rendering it as SVG. It uses `d3.scaleLinear` and `d3.scaleBand` for positioning, `d3.axisLeft` and `d3.axisBottom` for axes, and `d3.format` to abbreviate large numbers (e.g., converting billions to “B”). The chart includes a title, axis label, and grid lines, with a margin convention applied to the SVG layout.

AI-generated description

Data Visualization with D3 course; Bar Chart

<h3>Creating a Bar Chart</h3> <table> <th align="left">Topics</th> <tr> <td> <ul> <li><b>Representing a data table</b></li> <li><b>Creating rectangles for each row</b></li> <li><b>Using linear and band scales</b></li> <li><b>The margin convention</b></li> <li><b>Adding Axes</b> <ul> <li><b>Formatting numbers</b></li> <li><b>Removing unnecessary lines</b></li> <li><b>Adding a Title</b></li> <li><b>Adding Axes labels</b></li> <li><b>Making tick grid lines</b></li> </ul> </li> </ul> </td> </tr> </table>
MIT Licensed

Similar vizzes