ry0214_question 2
✓ Published0🌍 Public
This example visualizes the relationship between vehicle horsepower and highway fuel efficiency (MPG) across 31 car makes, from Scion to Maybach. An area chart displays the trend, with horsepower on the x-axis and highway MPG on the y-axis, using a semi-transparent steelblue fill to emphasize the decline in fuel economy as engine power increases. The visualization is built with D3 v7, employing `d3.scaleLinear` for axes, `d3.area` for the shaded region, and `d3.axisBottom`/`d3.axisLeft` for labeled ticks, alongside a simple legend. The SVG rendering uses data embedded directly in the script, with margins and dimensions set for a clean 800x500 layout.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG (pinned at v6, since this runtime environment only supports UMD, and in v7 D3 dropped UMD support)
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed