Acticity 7 tutorial2
✓ Published0🌍 Public
This example shows a stacked bar chart comparing average horsepower, torque, and highway MPG for several car makes, using an ordinal color scale and a legend to distinguish the three metrics. It renders the chart as an SVG and relies on D3.js version 7 APIs including `d3.stack` for data stacking, `d3.scaleBand` for categorical positioning, `d3.scaleLinear` for the y-axis, and `d3.axisBottom` with rotated labels to handle long axis text. The data is embedded directly in the script rather than loaded from an external file.
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.
MIT Licensed