Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

ICE7_Q3_Creating Line Chart with D3js

Public visualization

Viewing a saved revision (read-only)

42e282c140554417b5831a29f3ff2be5

ICE7_Q3_Creating Line Chart with D3js

0 stars1🌍 Public
PPbarring
Last edited Mar 28, 2022
Created on Mar 27, 2022

This example displays monthly gas prices for 2021 using an SVG line chart. The visualization uses D3 v5 to load CSV data and render a smooth curve, with labeled axes for months and price in dollars. It employs d3.scaleTime and d3.scaleLinear to map data values, d3.axisLeft and d3.axisBottom for gridlines and ticks, and d3.line with curveBasis for the curved path. The code also uses d3.csv for data parsing and d3.timeParse to convert month strings into date objects.

AI-generated description