D3 Boxplot
✓ Published0🌍 Public
This example presents a boxplot that visualizes the distribution of industrial natural gas prices in Hawaii, measured in dollars per million BTU. The plot summarizes the data’s minimum, first quartile, median, third quartile, and maximum values, which are computed from a CSV dataset using the d3.quantile, d3.min, and d3.max functions. The visualization is rendered as an SVG graphic, with the boxplot oriented vertically using a linear scale for the y-axis and a band scale for the x-axis. The code imports specific D3 v7 modules—including scaleLinear, scaleBand, axisLeft, and axisBottom—to construct the chart, while custom lines and rectangles are manually appended to the SVG to draw the box, whiskers, and median line.
AI-generated descriptionMIT Licensed