Skip to main content
100%

From bars to scatter plot with revert x and y

✓ Published1🌍 Public
FFrançois Plet
Last edited Jul 6, 2019
Created on Jul 6, 2019
Forked from custom axis

This example transforms a bar chart into a scatter plot by swapping the x and y axes, displaying country populations as evenly spaced circles with a fixed radius. The visualization uses D3 v5’s `scaleLinear` for the population axis and `scalePoint` for the categorical country axis, with `axisBottom` and `axisLeft` generating gridlines. Data comes from a local CSV loaded via `d3.csv`, and circles are appended to an SVG with click handlers that log each data point to the console.

AI-generated description
MIT Licensed

Similar vizzes