2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
|
title: Style D3 Labels
|
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Style D3 Labels
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
## Hints
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2018-10-17 22:03:24 +05:30
|
|
|
### Hint 1
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2018-10-17 22:03:24 +05:30
|
|
|
Chain two ` style() ` method together.
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2018-10-17 22:03:24 +05:30
|
|
|
### Hint 2
|
|
|
|
|
|
|
|
|
|
Use ` font-family ` in the first method and ` fill ` in the second method.
|
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
## Solutions
|
|
|
|
|
|
|
|
|
|
<details><summary>Solution 1 (Click to Show/Hide)</summary>
|
2018-10-17 22:03:24 +05:30
|
|
|
|
|
|
|
|
Add these lines to the end of the chain:
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
.style("font-size","25px")
|
|
|
|
|
.style("fill","red");
|
|
|
|
|
```
|
2019-07-24 00:59:27 -07:00
|
|
|
|
|
|
|
|
</details>
|