Skip to main content
100%

Vizhub Bar Graph

✓ Published0🌍 Public
CCH SAMPATH
Last edited Mar 22, 2023
Created on Mar 22, 2023

This example shows a horizontal bar chart of Amazon prices across different states, with country names on the y-axis and cost values on the x-axis. The visualization uses React hooks (useState and useEffect) to load CSV data from a GitHub gist, then renders the chart as SVG elements. The code employs d3.csv for data parsing, d3.scaleBand for the categorical y-axis, d3.scaleLinear for the numeric x-axis, and d3.max to determine the domain. A red gridline is drawn at each x-axis tick value, with the most recently imported year’s data shown.

AI-generated description

A whole smiley face

MIT Licensed

Similar vizzes