Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bar chart - Highest MPG

Public visualization

Viewing a saved revision (read-only)

1663e9b398264c0198fb57bbba8ff4bc

Bar chart - Highest MPG

0 stars0🌍 Public
Vvishusikka
Last edited May 5, 2022
Created on Apr 6, 2022
Forked from Hello VizHub

This example shows the highest city MPG vehicles by make, using a sequential bar chart where warmer reds indicate higher MPG values. The chart sorts car makes from lowest to highest MPG, with interactive tooltips displaying exact values on hover. Built with D3 v6, it uses `d3.scaleBand`, `d3.scaleLinear`, and `d3.scaleQuantize` to map data, while `d3.axisBottom` and `d3.axisLeft` render axes. A color legend from the d3-legend library explains the red color scale, and all graphics are drawn as SVG elements with mouseover/mouseout events.

AI-generated description