Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Question2

Public visualization

Question2

0 stars0🌍 Public
Gganesh.hns48@gmail.com
Last edited Apr 8, 2024
Created on Apr 8, 2024

This example shows a comparative area chart of monthly sales for two products during 2023, filled with distinct colors from a categorical scheme. The chart uses D3 v7’s `d3.scaleBand` for the month axis and `d3.scaleLinear` for the sales axis, with area paths generated via `d3.area`. Data is fetched as CSV from a GitHub repository, parsed with `d3.csvParse`, and rendered as SVG. A custom HTML legend, built with `d3.select` and `d3.selectAll`, displays color swatches and product labels alongside the chart.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed