🌍 Public
Viewing a saved revision (read-only)
e0fa40c5e7c544f59b1b4d0b1e1cc642
Creating a Bar Chart with D3.js
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 descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.