Skip to main content
100%

creating a bar chart using d3.js

✓ Published0🌍 Public
RRaja Srinivas Nelluri
Last edited Mar 7, 2022
Created on Mar 7, 2022

This example displays a horizontal bar chart ranking films by their audience scores, using a CSV dataset with movie titles and percentages. The visualization renders as SVG elements, with the y-axis positioning film names and the x-axis scaling scores from zero to the maximum value. Built with D3 v7, the code uses `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to construct the chart, while `csv()` loads the external data file. Rectangles are appended to a translated group, with bar widths proportional to each score.

AI-generated description
MIT Licensed

Similar vizzes