Skip to main content
100%

Scatter Plot - Insurance Charges by Age

✓ Published2🌍 Public
RRaul Gamez
Last edited Sep 23, 2021
Created on Sep 13, 2021

This scatter plot visualizes insurance charges for individuals based on age, with each circle’s color indicating smoking status—red for smokers and black for non-smokers. The chart, rendered as SVG using D3 v6, loads data from a CSV file via `d3.csv`, applies linear scales via `d3.scaleLinear`, and uses `d3.axisLeft` and `d3.axisBottom` for axes. The code joins circles to data with `selectAll().data().join()` and sets fill opacity to 0.35.

AI-generated description

A scatter plot using D3 displaying insurance charges data from the Insurance Expenses Dataset.

The age of the insurance user is displayed on the x-axis, their total insurance charges in dollars on the y-axis and their smoking status on the color of the circles (black if they don't smoke or red if they do).

MIT Licensed

Similar vizzes