-
Book Overview & Buying
-
Table Of Contents
Learn D3.js - Second Edition
By :
This chapter explained the use of layout generator functions from the d3-shape module to efficiently transform data for creating pie charts, doughnut charts, as well as stacked area and bar charts.
A pie generator converts data into angles used to draw arcs. To create a pie chart, you used an arc function, also introduced in this chapter, to generate SVG path strings for the slices. A stack generator computes coordinates by adding up values in different series for the same observations. This makes it easier to set baselines and toplines and stack areas for a multi-series area chart or stacked bar chart. You learned how to create both types of stacked charts in this chapter.
These tools were introduced using very simple examples, so we could focus on their most important aspects, try out different configuration options, and understand how the data is transformed in each case. As in previous chapters, we also explored these topics by creating a larger application with external...