Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Barchart Styling

Public visualization

Barchart Styling

0 stars1🌍 Public
Ccaineosborne
Last edited Jan 14, 2022
Created on Jan 14, 2022

This example demonstrates a horizontal bar chart visualizing the population of ten countries, sourced from a UN 2019 dataset. The bars are styled with a distinct teal fill and black outlines, while the chart employs a categorical y-axis and a quantitative x-axis. Using React state via the `useData` hook to manage fetched CSV data, the visualization is rendered as SVG through components that build the axes and marks. The code leverages d3's `scaleBand` and `scaleLinear` for scaling, `format` for tick labels, and custom reusable React components for marks and axes.

AI-generated description

A program that loads in some data about CSS named colors using d3 utilities, and uses React state to keep track of the data.

Comments

Sign in to join the discussion.

MIT Licensed