mirror of
https://github.com/timberjoegithub/grafana-statusmap.git
synced 2026-07-21 23:42:03 +00:00
Merge pull request #139 from flant/fix_legend_scale
fix: add condition for noDatapoints state
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
/dist linguist-generated
|
||||||
|
/src/libs/d3-scale-chromatic linguist-vendored
|
||||||
Vendored
+4
-4
@@ -366,17 +366,17 @@ System.register(["lodash", "jquery", "d3", "./libs/d3-scale-chromatic/index", "a
|
|||||||
if (ctrl.bucketMatrix) {
|
if (ctrl.bucketMatrix) {
|
||||||
var rangeFrom = ctrl.bucketMatrix.minValue;
|
var rangeFrom = ctrl.bucketMatrix.minValue;
|
||||||
var rangeTo = ctrl.bucketMatrix.maxValue;
|
var rangeTo = ctrl.bucketMatrix.maxValue;
|
||||||
var maxValue = panel.color.max || rangeTo;
|
var maxValue = panel.color.max != null ? panel.color.max : rangeTo;
|
||||||
var minValue = panel.color.min || rangeFrom;
|
var minValue = panel.color.min != null ? panel.color.min : rangeFrom;
|
||||||
|
|
||||||
if (ctrl.bucketMatrix.noDatapoints) {
|
if (ctrl.bucketMatrix.noDatapoints) {
|
||||||
if (!panel.color.max) {
|
if (panel.color.max != null) {
|
||||||
rangeTo = maxValue = 100;
|
rangeTo = maxValue = 100;
|
||||||
} else {
|
} else {
|
||||||
rangeTo = 100;
|
rangeTo = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!panel.color.min) {
|
if (panel.color.min != null) {
|
||||||
rangeFrom = minValue = 0;
|
rangeFrom = minValue = 0;
|
||||||
} else {
|
} else {
|
||||||
rangeFrom = 0;
|
rangeFrom = 0;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -462,8 +462,8 @@ System.register(["lodash", "jquery", "moment", "app/core/utils/kbn", "app/core/c
|
|||||||
value: function addStatusmap() {
|
value: function addStatusmap() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
var maxValue = this.panel.color.max || this.bucketMatrix.maxValue;
|
var maxValue = this.panel.color.max != null ? this.panel.color.max : this.bucketMatrix.maxValue;
|
||||||
var minValue = this.panel.color.min || this.bucketMatrix.minValue;
|
var minValue = this.panel.color.min != null ? this.panel.color.min : this.bucketMatrix.minValue;
|
||||||
|
|
||||||
if (this.panel.color.mode !== 'discrete') {
|
if (this.panel.color.mode !== 'discrete') {
|
||||||
this.colorScale = this.getColorScale(maxValue, minValue);
|
this.colorScale = this.getColorScale(maxValue, minValue);
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+2
-2
@@ -72,12 +72,12 @@ coreModule.directive('statusHeatmapLegend', function() {
|
|||||||
let minValue = panel.color.min != null ? panel.color.min : rangeFrom;
|
let minValue = panel.color.min != null ? panel.color.min : rangeFrom;
|
||||||
|
|
||||||
if (ctrl.bucketMatrix.noDatapoints) {
|
if (ctrl.bucketMatrix.noDatapoints) {
|
||||||
if (!panel.color.max) {
|
if (panel.color.max != null) {
|
||||||
rangeTo = maxValue = 100;
|
rangeTo = maxValue = 100;
|
||||||
} else {
|
} else {
|
||||||
rangeTo = 100;
|
rangeTo = 100;
|
||||||
}
|
}
|
||||||
if (!panel.color.min) {
|
if (panel.color.min != null) {
|
||||||
rangeFrom = minValue = 0;
|
rangeFrom = minValue = 0;
|
||||||
} else {
|
} else {
|
||||||
rangeFrom = 0;
|
rangeFrom = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user