Chapter 5. Playing with Axes

In this chapter, we will cover:

  • Working with basic axes
  • Customizing ticks
  • Drawing grid lines
  • Dynamic rescaling of axes

Introduction

D3 was initially released without the built-in support of the Axis component. This situation did not last long since axes are the universal building blocks in many Cartesian coordinate system-based visualization projects and one of the most tedious tasks to build from scratch by hand. It quickly became clear that D3 needs to provide built-in support for axes. Therefore, it was introduced quite early on and is continuously being enhanced ever since it was released. In this chapter, we will explore the usage of the Axis component and some related techniques.

Get Data Visualization with D3 4.x Cookbook - Second Edition 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.