Skip to main content
100%

Bar Chart Example

✓ Published0🌍 Public
Aachyutanandmishra17@gmail.com
Last edited Mar 22, 2023
Created on Mar 22, 2023
Forked from HTML Starter

This example displays a horizontal bar chart ranking the average monthly cost of dog breeds across 12 countries, using a dataset loaded from a CSV file. The visualization is rendered as an SVG with React and D3 v6, where `scaleBand` positions the country labels on the y-axis and `scaleLinear` maps cost values to bar widths. Custom axes are drawn manually with `xScale.ticks()` and grid lines, while the bars are simple `<rect>` elements. The code also includes an alternative vanilla JavaScript implementation using `d3.axisBottom` and `d3.axisLeft`.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes