I didn't think to try ChatGPT before.
It gave me the following solution but it does nothing (not even set the greens/reds..
{"field":"Adult CAP", 'tooltipValueGetter': {"function": "params.data.DRLcount + ' scans included'"},
'cellStyle': {
# This function checks for empty values (None or empty string)
'function': '''
function(params) {
// Check if the value is null, undefined, or empty
if (params.value === null || params.value === undefined || params.value === '') {
return null; // No style applied for empty cells
}
// Apply some style conditions if the cell is not empty
if (params.value > 7) {
return { backgroundColor: 'redn' };
} else {
return { backgroundColor: 'green' };
}
}
'''
}
I also tried forcing nan's to zeroes and then the following:
{"field":"Adult CAP", 'tooltipValueGetter': {"function": "params.data.DRLcount + ' scans included'"},
'cellStyle': {"styleConditions": [{"condition": "0 > params.value <= 11","style": {"backgroundColor": "#16F529"}},
{"condition": "params.value > 11","style": {"backgroundColor": "#FD1C03"}}, {"condition": "params.value == 0","style": {"backgroundColor": "#FD1C03"}}]}},
It still colours my 0's green?