Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #209 from flant/fix_null_as_zero
Browse files Browse the repository at this point in the history
fix: null as zero
  • Loading branch information
diafour committed Jul 19, 2021
2 parents ba27b10 + 0b5ce08 commit bc96037
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,10 @@ export class StatusmapRenderer {
if (this.panel.color.mode === 'opacity') {
return this.panel.color.cardColor;
} 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);
} else if (this.panel.color.mode === 'discrete') {
if (this.panel.seriesFilterIndex !== null && this.panel.seriesFilterIndex !== -1) {
Expand Down

0 comments on commit bc96037

Please sign in to comment.