Skip to main content
100%

Sales Trend by Month

✓ Published0🌍 Public
TThanaporn-sk
Last edited Mar 9, 2017
Created on Mar 9, 2017

This example shows monthly sales trends across five years (2011–2015) as a single continuous area chart, with each year labeled at the top of the categorical x-axis and mean lines positioned dynamically on the y-axis. The code uses d3.js v4 to define linear scales, a line generator, and an area generator, and appends SVG groups to place category labels. Data is embedded inline as JSON, and a tooltip div appears on hover. The chart resizes to the window using jQuery for dimensions.

AI-generated description

This is an example of producing a single area chart rendered using d3.js with mean lines positioned dynamically on the y-axis, and the x-axis customized to show categorical ranges, with svg g used to append category labels at top.

forked from <a href='http://bl.ocks.org/Mbrownshoes/'>Mbrownshoes</a>'s block: <a href='http://bl.ocks.org/Mbrownshoes/ece2baff7112f0d4568ae5f94fcd833c'>A single d3.js V4 chart with 'small multiples' along single categorical x-axis</a>

mit Licensed

Similar vizzes