Scatter Plot - Insurance Charges by Age
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 descriptionA 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).