🌍 Public
Viewing a saved revision (read-only)
f3185c3d1e2a47ee9a9d8947fb797773
making a bar chart
This example renders a blank SVG bar chart canvas sized 960 by 500 pixels. It demonstrates how to load D3 v7 from UNPKG, import the `select` function from the `d3` module, and parse SVG dimensions using both `parseFloat` and the unary `+` operator. The code selects the existing SVG element and converts its height and width attributes from strings to numbers for later use. The example shows the foundational setup for building a chart, with no actual bars or data plotted yet.
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.