Skip to main content
Public

Share visualization

Loading preview…

Assignment2Question2

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Assignment2Question2

1
Gganesh.hns48@gmail.com
Last edited Apr 8, 2024
Created on Apr 8, 2024

This D3.js v7 example creates an SVG area chart that visualizes monthly sales data for two products during 2022. The chart displays values from the embedded data array, with product1 and product2 each shown as filled areas using `d3.area()` and a categorical color scale via `d3.scaleOrdinal` with `d3.schemeCategory10`. A legend is generated using D3’s selection API to map colors to product names, while axes are created with `d3.axisBottom` and `d3.axisLeft`, and data is scaled using `d3.scaleBand` and `d3.scaleLinear`.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed