Skip to main content
100%

Scatter Plot and Bar Chart

✓ Published0🌍 Public
Mmdadeebfarhaan@gmail.com
Last edited Apr 26, 2024
Created on Apr 26, 2024
Forked from Hello VizHub

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 description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes