Skip to main content
100%

third

✓ Published1🌍 Public
119h61a05c9@cvsr.ac.in
Last edited Oct 28, 2025
Created on Oct 28, 2025
Forked from D3 Starter

This example shows the monthly sales trend from 2021 to 2025 as a smooth line chart. The chart displays a single steelblue line with orange data points, with rotated month labels on the x-axis and a linear y-axis. Built with D3 v6, the code uses `d3.csv` to load `sales_trend.csv`, `d3.scaleTime` and `d3.scaleLinear` for axes, `d3.line` with `d3.curveMonotoneX` for the smoothed path, and `d3.axisBottom` and `d3.axisLeft` for tick marks. The SVG rendering includes a title and axis labels.

AI-generated description

Monthly Sales Trend Visualization

This project visualizes monthly sales data from 2021 to 2025 using D3.js.

Files

  • index.html: Main HTML file
  • index.js: JavaScript implementation for the line chart
  • sales_trend.csv: Sales data by month

How to Run

  1. Open index.html in a web browser
  2. The line chart will automatically load and display the sales trend

Data Format

The CSV file contains two columns:

  • month: Month and year in format "MMM-YYYY" (e.g., "Jan-2021")
  • sales: Sales figures for that month
MIT Licensed

Similar vizzes