From bars to scatter plot with revert x and y
✓ Published1🌍 Public
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 descriptionMIT Licensed