Book Image

Mastering D3.js

By : Pablo NAVARRO CASTILLO
Book Image

Mastering D3.js

By: Pablo NAVARRO CASTILLO

Overview of this book

If you are a software developer working with data visualizations and want to build complex data visualizations, this book is for you. Basic knowledge of D3 framework is expected. With real-world examples, you will learn how to structure your applications to create enterprise-level charts and interactive dashboards.
Table of Contents (14 chapters)
13
Index

Creating tooltips


A tooltip is a small element that provides contextual information when the user locates the pointer over an element. This allows you to provide details without cluttering the visualization. In this section, we will create the tooltip as a reusable chart but with a different structure than that in the previous examples. In the previous charts, we bound the data to a selection of containers for the charts; while in this case, the tooltip chart will be bound to the element on which the tooltip should appear. This implies that the selection argument in the charting function contains the elements on which the tooltip will appear. In the case of the fruit chart, we will want the tooltip to appear when the user moves the pointer over the circles, follow the pointer as it moves over the circle, and disappear when the pointer leaves the circle. We will create a tooltip as a reusable chart, but instead of invoking the tooltip on a selection of containers, we will invoke the tooltip...