Merge pull request #209 from flant/fix_null_as_zero

fix: null as zero
This commit is contained in:
Ivan Mikheykin
2021-07-19 21:17:17 +03:00
committed by GitHub
+4
View File
@@ -578,6 +578,10 @@ export class StatusmapRenderer {
if (this.panel.color.mode === 'opacity') { if (this.panel.color.mode === 'opacity') {
return this.panel.color.cardColor; return this.panel.color.cardColor;
} else if (this.panel.color.mode === 'spectrum') { } else if (this.panel.color.mode === 'spectrum') {
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); return this.colorScale(bucket.value);
} else if (this.panel.color.mode === 'discrete') { } else if (this.panel.color.mode === 'discrete') {
if (this.panel.seriesFilterIndex !== null && this.panel.seriesFilterIndex !== -1) { if (this.panel.seriesFilterIndex !== null && this.panel.seriesFilterIndex !== -1) {