🌍 Public
Viewing a saved revision (read-only)
0d8dc8e90b7d449a9d6cdb3c3089a14f
d3.js learning
This example shows a stacked bar chart of fruit production from 2006 to 2015, with four series (Red Delicious apples, McIntosh apples, oranges, and pears) drawn as colored rect layers. The chart uses d3.layout.stack to transform the data, d3.time.format to parse years, and ordinal and linear scales to position the bars and axes. A legend maps colors to fruit names, and a tooltip—created as an SVG group with rect and text elements—displays the numeric value of each segment on mouseover. The SVG is rendered inside a React framework, with axes drawn using d3.svg.axis.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.