Scatter Plot and Bar Chart
✓ Published0🌍 Public
This example presents two linked visualizations of country-level data: a scatter plot mapping population (2022) against population density, and a bar chart showing the same population values per country. Both charts use D3.js v7, loaded via UNPKG, and render as SVGs within separate container divs. The code employs `d3.csv` to fetch remote CSV data, then builds the visuals with `d3.select`, `d3.scaleLinear`, `d3.scaleBand`, `d3.axisBottom`, `d3.axisLeft`, and `d3.extent`. Interactive tooltips appear on mouseover for scatter points, using a positioned HTML div to display country, population, and density values.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed