Hello - I am trying to change the color of a value shown based on a range. For instance, numbers 4-5 red, 2-3.9 yellow, 0.1-1.9 green. My expression looks like this:
var color=When($datapoint.Score >=4, '#ff0000',$datapoint.Score >=2, 'ffff00',$datapoint.Score >=0, '#65a843','')
return {
//textColor:'',
//backgroundColor:'',
topText: ' '+$datapoint.NAME+' Score',
topTextColor: '#2c3648',
topTextOutlineColor: '',
topTextMaxSize: 'medium',
middleText: $datapoint.Score,
middleTextColor: 'color',
middleTextOutlineColor: 'black',
middleTextMaxSize: 'large',
//bottomText: '',
//bottomTextColor: '',
//bottomTextOutlineColor: '',
//bottomTextMaxSize: 'medium',
//iconName:'',
//iconAlign:'left',
//iconColor:'',
//iconOutlineColor:'',
//noValue:false,
//attributes: {
// attribute1: '',
// attribute2: ''
// }
}
Any suggestions on what I am missing?