Skip to main content
100%

Bar Chart with D3.js

✓ Published0🌍 Public
VVenkat-Sumith-Thota
Last edited Jul 15, 2023
Created on Jul 15, 2023
Forked from Hello VizHub

This example displays a bar chart of five categorical values, including topics like data visualization and machine learning, using D3.js with SVG rendering. The code loads D3 v6 from a CDN and builds the visualization with `d3.scaleBand` for the x-axis, `d3.scaleLinear` for the y-axis, and `d3.axisBottom` and `d3.axisLeft` to render the axes. Steel-blue bars are appended via `selectAll` and `enter`, with dimensions derived from the scales. The dataset is hardcoded in the script, and the chart is placed inside a div with the ID "chart".

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.
MIT Licensed

Similar vizzes