Chapter 2. Reusable Charts

In this chapter, we will learn how to create configurable charts and layout algorithms and how to use these components. One important characteristic of configurable charts is that we can use them in different contexts without having to change the code. In this chapter, we will cover the following topics:

  • Learn how to create reusable charts
  • Create a reusable barcode chart
  • Create a reusable layout algorithm
  • Use the layout and the barcode chart

We will begin by defining what we understand by reusable charts and construct a reusable chart from scratch.

Creating reusable charts

A chart is a visual representation of a dataset. As datasets grow in complexity and number of elements, we might want to encapsulate the chart in a reusable ...

Get D3.js: Cutting-edge Data Visualization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.