--- id: 5d8a4cfbe6b6180ed9a1ca4c title: Part 109 challengeType: 0 dashedName: part-109 --- # --description-- The text elements are at the center of the pie graph, you need to use the `centroid` from the D3 arc API to tell them where to go. Add an `attr` function to set the `transform` to a `d` function that returns this template literal: `translate(${ pieArc.centroid(d) })` The `centroid` function will find the midpoint of each slice for each text element. # --hints-- test-text ```js const transform = $('.dashboard div svg g text')[0] .getAttribute('transform') .replace('translate(', '') .replace(')', '') .split(','); assert(transform[0] < 39 && transform[1] > 31); ``` # --seed-- ## --before-user-code-- ```html D3 Dashboard
``` ## --seed-contents-- ```html ``` # --solutions-- ```html ```