Skip to main content
100%

[A6] Vehicle Power vs. MPG (Scatter Plot With Qualitative Color Scale)

✓ Published0🌍 Public
Cctan13@dons.usfca.edu
Last edited Mar 15, 2024
Created on Mar 4, 2024
Forked from HTML Starter

This scatter plot compares vehicle torque and horsepower, with each point’s size encoding MPG. The chart uses a qualitative color scale to distinguish car makes—Audi in blue, Chevrolet in red, and Volvo in green—via `d3.scaleOrdinal` and a `d3.legendColor` legend. Data from a CSV file is loaded with `d3.csv`, parsed, and mapped to linear scales for the x- and y-axes, while circle radii are scaled by MPG using `d3.scaleLinear`. The SVG rendering is handled by D3 v7, with axes, labels, and a triangular-symbol legend drawn programmatically.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes