Skip to main content
100%

ICE-6: Rendering Marks and Channels (Bar Chart)

✓ Published18🌍 Public
Ggeethikal
Last edited Mar 10, 2023
Created on Mar 10, 2023
Forked from HTML Starter

This example renders a horizontal bar chart using React and D3 v5, displaying the 2022 population for three countries from a CSV dataset. The visualization uses SVG marks and channels, with `scaleBand` for the categorical y-axis and `scaleLinear` for the numeric x-axis. React state manages the asynchronous CSV loading via D3’s `csv` function, while the code manually draws axis ticks, gridlines, and colored rectangles. The chart includes a purple vertical grid and labeled axes, with data filtered to the first three rows of the source CSV.

AI-generated description

A bare minimum HTML page.

MIT Licensed

Similar vizzes