Adding Labels

We can use the ‘call()’ function to reuse the same selection multiple times, which is useful when creating multiple labels.

We'll cover the following

We are going to add some labels to the pie chart. Labels will help the reader understand each slice of the pie. Once we add some labels, a new problem will become apparent. We will talk about that in a moment. Let’s begin adding some labels.

Drawing labels

We will be working under the section where we drew the shapes. We are going to create a group separate from the arcs. We are going to create a copy of the arcs group selection. The variable will be renamed to labelsGroup.

Get hands-on with 1200+ tech skills courses.