Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Akhil -vizhub assignment bat-scatter

Public visualization

Viewing a saved revision (read-only)

a9db2abcfd5e43dc9672ce66b04ce2c5

Fork of Akhil -vizhub assignment bat-scatter

0 stars0🌍 Public
MM
Last edited Mar 18, 2024
Created on Mar 18, 2024

This example visualizes the relationship between car type and total price using a bar chart, with horizontal bars showing aggregated price sums per car category. The code uses React state and effects to load CSV data via D3’s `csv` method, then aggregates prices by car type with a reduce operation. D3’s `scaleBand` and `scaleLinear` map the categorical types and continuous price values, while `axisBottom` and `axisLeft` render the axes. The SVG rendering approach positions bars and labels, with title text annotating the chart. Data comes from a cleaned cars dataset hosted in a GitHub gist.

AI-generated description