I'm trying to create a range of SVG images that represent a member in a team. The number of person svg image show up based on total number of members in the team. Following are some important points:
- Some members have scores and some don't
- Each person SVG image represent a member in the team
- The color for the SVG team should map to the score value
- The score value ranges from 1 - 5
I've created the stackblitz to show what I've done in Angular and d3 v5. For some reason, the images are not showing in StackBlitz but it works on my local machine.
Ask
The problem I'm facing is that the color on the Person images do not match with the color legend and value. I couldn't figure out why neither how to fix it.
The image currently looks like this:
The data
this.teamScores = [
{
"memberPersonID": "2892082",
"score": 3.8571
},
{
"memberPersonID": "2917522",
"score": 3
},
{
"memberPersonID": "2917524",
"score": 3.2857
},
{
"memberPersonID": "2917517",
"score": 3.2857
},
{
"memberPersonID": "2917520",
"score": 3.4286
},
{
"memberPersonID": "2917519",
"score": 3
},
{
"memberPersonID": "2917523",
"score": 3.1429
}
]
Please note the score values and the legend. The colors currently do not seem like it's mapping to the actual score.
