mirror of
https://github.com/timberjoegithub/grafana-statusmap.git
synced 2026-07-22 15:53:09 +00:00
Merge pull request #19 from flant/fix_null_values_as_zero
Fix null values displayed as zeros
This commit is contained in:
@@ -144,6 +144,10 @@ This plugin is based on "Heatmap" panel by Grafana and partly inspired by ideas
|
|||||||
|
|
||||||
#### Changelog
|
#### Changelog
|
||||||
|
|
||||||
|
##### v0.0.3
|
||||||
|
|
||||||
|
- Fix display null values as zero
|
||||||
|
|
||||||
##### v0.0.2
|
##### v0.0.2
|
||||||
|
|
||||||
- Install with GF_INSTALL_PLUGINS
|
- Install with GF_INSTALL_PLUGINS
|
||||||
|
|||||||
Vendored
+4
@@ -144,6 +144,10 @@ This plugin is based on "Heatmap" panel by Grafana and partly inspired by ideas
|
|||||||
|
|
||||||
#### Changelog
|
#### Changelog
|
||||||
|
|
||||||
|
##### v0.0.3
|
||||||
|
|
||||||
|
- Fix display null values as zero
|
||||||
|
|
||||||
##### v0.0.2
|
##### v0.0.2
|
||||||
|
|
||||||
- Install with GF_INSTALL_PLUGINS
|
- Install with GF_INSTALL_PLUGINS
|
||||||
|
|||||||
Vendored
+8
-1
@@ -103,6 +103,13 @@ System.register(["lodash"], function (_export, _context) {
|
|||||||
|
|
||||||
for (var i = 0; i < thresholds.length; i++) {
|
for (var i = 0; i < thresholds.length; i++) {
|
||||||
for (var j = 0; j < values.length; j++) {
|
for (var j = 0; j < values.length; j++) {
|
||||||
|
if (values[j] == null) {
|
||||||
|
if (this.panel.nullPointMode == 'as zero') {
|
||||||
|
return this.getMatchedThreshold(0).color;
|
||||||
|
} else {
|
||||||
|
return 'rgba(0,0,0,0)';
|
||||||
|
}
|
||||||
|
}
|
||||||
if (values[j] == thresholds[i].value) {
|
if (values[j] == thresholds[i].value) {
|
||||||
return this.getDiscreteColor(i);
|
return this.getDiscreteColor(i);
|
||||||
}
|
}
|
||||||
@@ -135,7 +142,7 @@ System.register(["lodash"], function (_export, _context) {
|
|||||||
key: "getMatchedThreshold",
|
key: "getMatchedThreshold",
|
||||||
value: function getMatchedThreshold(value) {
|
value: function getMatchedThreshold(value) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
if (this.panel.color.nullPointMode == 'as empty') {
|
if (this.panel.nullPointMode == 'as empty') {
|
||||||
// FIXME: make this explicit for user
|
// FIXME: make this explicit for user
|
||||||
// Right now this color never used because null as empty handles in getCardOpacity method.
|
// Right now this color never used because null as empty handles in getCardOpacity method.
|
||||||
return {
|
return {
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -63,6 +63,13 @@ export class ColorModeDiscrete {
|
|||||||
|
|
||||||
for (let i = 0; i < thresholds.length; i++) {
|
for (let i = 0; i < thresholds.length; i++) {
|
||||||
for (let j = 0; j < values.length; j++) {
|
for (let j = 0; j < values.length; j++) {
|
||||||
|
if (values[j] == null) {
|
||||||
|
if (this.panel.nullPointMode == 'as zero') {
|
||||||
|
return this.getMatchedThreshold(0).color;
|
||||||
|
} else {
|
||||||
|
return 'rgba(0,0,0,0)';
|
||||||
|
}
|
||||||
|
}
|
||||||
if (values[j] == thresholds[i].value) {
|
if (values[j] == thresholds[i].value) {
|
||||||
return this.getDiscreteColor(i);
|
return this.getDiscreteColor(i);
|
||||||
}
|
}
|
||||||
@@ -93,7 +100,7 @@ export class ColorModeDiscrete {
|
|||||||
|
|
||||||
getMatchedThreshold(value) {
|
getMatchedThreshold(value) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
if (this.panel.color.nullPointMode == 'as empty') {
|
if (this.panel.nullPointMode == 'as empty') {
|
||||||
// FIXME: make this explicit for user
|
// FIXME: make this explicit for user
|
||||||
// Right now this color never used because null as empty handles in getCardOpacity method.
|
// Right now this color never used because null as empty handles in getCardOpacity method.
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user