0👍
✅
There are 2 errors that are happening when returning the color:
-
when returning the colors you’re actually returning booleans, as mentioned in the comments it should just be the strings
-
indexed is an array, so indexed==0 isn’t correct, what you actually want to do is check against the target index in indexed
Your final if should look like this:
if (indexed[context.dataIndex] == 0){return 'blue'}else{return 'red'}
Source:stackexchange.com