Viewing a saved revision (read-only)
65fc286087d74605a7b19f3b70275b67
Despeses Pressupost 2021
This example displays the top ten budget expenditures for the 2021 Catalan budget as a horizontal bar chart, using a quantitative axis for spending amounts and a categorical axis for budget items. The visualization loads CSV data from a GitHub gist and processes it with `d3.csv` and `d3.max` to set the linear scale. React manages the component state and rendering, while SVG elements are positioned using `d3.scaleBand` and `d3.scaleLinear`. The chart includes grid lines and tick labels generated from `xScale.ticks()`, with each bar’s height determined by the band scale’s bandwidth.
AI-generated descriptionA program that loads in some data about CSS named colors using d3 utilities, and uses React to render the data.