Why won't my if statement work to seperate dots?

Hi all

On line 68:
.attr("fill", (item) => {if(item["Doping"] == ""){return "orange"}else{return "navy"}})
my if statement won’t work

The aim is to colour dots in two different colours depending on whether the ‘doping’ value of each datapoint is empty or not

Is there something wrong with how I’ve written it?

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36

Challenge: Visualize Data with a Scatterplot Graph

Link to the challenge:

You just need to change the value of data in line 58 to unmappedDataset.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.