I managed, at least in my particular case. I am comparing different countries - they are in the middle of the graph (C1, C2) and I have values 0-100 (percentage). In some cases, I have no data. This is my code at the moment:
marker: {line: {width: 2},
colors: sunburstgraphRates,
cmin: -100,
cmax: 100,
colorscale: [
[0, '#ebebeb'], [0.25, '#d8d8d8'],
[0.50, '#19c8aa'], [0.55, '#17ce4a'],
[0.60, '#8cd914'], [0.65, '#dcdd13'],
[0.70, '#dfc813'], [0.75, '#e0af12'],
[0.80, '#e29712'], [0.85, '#e37e11'],
[0.90, '#e56411'], [0.95, '#e64a11'],
[1, '#e92210']
],
showscale: false,
autocolorscale: false,
colorbar: {
title: 'Rate',
thickness: 25,
len: 0.9,
outlinewidth: 0,
x:1.1,
y:0.5,
tickmode: 'auto',
nticks: 10
},
}
To C1/C2 I assign value “-100” - it will be colored #ebebeb. When I have no data, I assign value “-50” - the color will be #d8d8d8. The rest of the values are always 0-100 and they will be assigned colors like in the colorscale above (0.50-1).
In my case the array you mention has values: -100 for each country in the middle, and then the actual percentage (0-100) for each element P, except when there is no data, then that element gets -50.
I hope you can figure out how to apply this to your case.