Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Reusable D3 Scatter Plot

Public visualization

Viewing a saved revision (read-only)

4e94c4ff1d9140f89c1f407a8d59ae0a

Fork of Reusable D3 Scatter Plot

0 stars0🌍 Public
NNaveed945
Last edited Jul 4, 2022
Created on Jun 30, 2022

This fork of a reusable D3 scatter plot animates through four variables from a grocery store dataset, cycling Profit, Quantity, Selling_Price, and Cost_Price on the x-axis while Cost_Price remains on the y-axis. SVG circles are colored by category (Frozen, Grocery, Produce) using a switch statement, with the reusable `scatterPlot()` module handling scales and axes via `scaleLinear`, `axisLeft`, and `axisBottom`. A `setInterval` triggers the x-value changes, rebuilding the plot and updating the axis labels, while custom legends and titles are appended dynamically. Data comes from a CSV loaded with `d3.csv`.

AI-generated description

A reusable scatter plot inspired by Towards Reusable Charts.

Shows the Iris Dataset.