Making a Bar Chart
✓ Published0🌍 Public
This example shows a bar chart ranking the populations of 18 countries, with the data sourced from a DataHub CSV file. The chart uses D3 v5's `scaleBand` for the categorical country axis and `scaleLinear` for the continuous population axis, rendering purple rectangles in an SVG. The code includes data parsing with `csv` and population values converted to thousands for display. A simple "Hello World" text label is appended to the chart, while axes and labels are generated using the `axisBottom` and `axisLeft` functions.
AI-generated descriptionThis bar chart data comes from (https://datahub.io/JohnSnowLabs/population-figures-by-country#resource-population-figures-by-country-csv).
MIT Licensed