Skip to main content
100%

Simple bar graph in v5

✓ Published0🌍 Public
Dd3noob
Last edited Nov 26, 2019
Created on Nov 26, 2019

This example shows a simple bar chart of sales figures by salesperson, with steel-blue bars and labeled axes on both sides. The data comes from a CSV file containing names and numeric sales values. The code creates a band scale for the x-axis and a linear scale for the y-axis, then uses `d3.csv` to load the data and `d3.axisBottom` and `d3.axisLeft` to render the axes. Bars are appended as SVG `rect` elements, with widths and heights computed from the scales. The chart uses D3 v5 and is rendered entirely in SVG.

AI-generated description

This is a simple bar graph written using d3.js v5.

This graph is part of the code samples for the update to the book D3 Tips and Tricks to version 5 of d3.js.

mit Licensed

Similar vizzes