Created
December 8, 2020 05:05
-
-
Save JakenHerman/90022cfcd1198ab0d7120f20189df06f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
text = svg.selectAll('.percentRank') | |
.data(percentileData) | |
.enter() | |
.append('text') | |
.attr('class', 'percentRank') | |
.attr('x', d => getTextXValue(d.cx)) | |
.attr('y', d => d.cy + 3) | |
.text(d => Math.floor((d.cx/150)*100)) | |
.attr('font-weight', 'bolder') | |
.attr('font-size', '.7rem') | |
.attr('fill', d => (Math.floor((d.cx/150)*100) >= 70 || | |
Math.floor((d.cx/150)*100) <= 30) | |
? 'white' : 'black'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment