fix(render): null as zero for spectrum mode (continue #205)

This commit is contained in:
Ivan Mikheykin
2021-07-19 21:02:50 +03:00
parent c1a3b91082
commit 0b5ce0831e
+6 -8
View File
@@ -578,14 +578,12 @@ export class StatusmapRenderer {
if (this.panel.color.mode === 'opacity') {
return this.panel.color.cardColor;
} else if (this.panel.color.mode === 'spectrum') {
if(bucket.value !== null) {
return this.colorScale(bucket.value);
} else {
if(this.panel.nullPointMode == 'as zero') {
return this.colorScale(0);
}
}
} else if (this.panel.color.mode === 'discrete') {
if (!bucket.value && this.panel.nullPointMode === 'as zero') {
// bucket.value === 0 falls here, but it is fine.
return this.colorScale(0);
}
return this.colorScale(bucket.value);
} else if (this.panel.color.mode === 'discrete') {
if (this.panel.seriesFilterIndex !== null && this.panel.seriesFilterIndex !== -1) {
return this.ctrl.discreteExtraSeries.getBucketColorSingle(bucket.values[this.panel.seriesFilterIndex]);
} else {