Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Creating a Bar Chart with D3.js

Public visualization

Viewing a saved revision (read-only)

e0fa40c5e7c544f59b1b4d0b1e1cc642

Creating a Bar Chart with D3.js

0 stars1🌍 Public
Ssaiyogesh9911@gmail.com
Last edited Mar 21, 2024
Created on Mar 20, 2024

This example shows a bar chart of Walmart’s weekly sales per store, using bar height to encode the sales amount and the x-axis to identify each store. The code loads a CSV dataset from a GitHub URL and renders the chart as SVG elements. It uses D3.js v5 with `d3.csv`, `scaleBand`, `scaleLinear`, `axisBottom`, and `axisLeft`, while React manages the page structure. The visualization also rotates the x-axis labels for readability and uses maroon bars to represent the sales values.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.