Skip to main content
100%

creating a barchart

✓ Published0🌍 Public
Vvidhyanamini
Last edited Mar 4, 2022
Created on Mar 4, 2022

This example creates a static bar chart visualizing cricket players’ career runs using a CSV dataset. The code loads data with `d3.csv`, parses the `RUNS` field as a number, and appends SVG `<rect>` elements using D3’s selection and data-join methods. It defines a linear scale with `d3.scaleLinear` (using a typo, `scaleLiner`) to map the maximum run value to the chart width. The React-based setup relies on UMD builds from unpkg, though the chart is rendered imperatively with D3 rather than through React components.

AI-generated description
MIT Licensed

Similar vizzes