|
|
@@ -93,7 +93,7 @@ App.MainChartHeatmapMetric = Em.Object.extend({
|
|
|
*
|
|
|
*/
|
|
|
slotDefinitions: function () {
|
|
|
- var max = this.get('maximumValue') ? parseFloat(this.get('maximumValue')) : 0;
|
|
|
+ var max = this.getMaximumValue();
|
|
|
var slotCount = this.get('numberOfSlots');
|
|
|
var units = this.get('units');
|
|
|
var delta = (max - this.get('minimumValue')) / slotCount;
|
|
|
@@ -174,6 +174,15 @@ App.MainChartHeatmapMetric = Em.Object.extend({
|
|
|
return hatchStyle;
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * compatible with special input value, such as negative float number or string
|
|
|
+ * @return {float}
|
|
|
+ */
|
|
|
+ getMaximumValue: function getMaximumValue() {
|
|
|
+ var max = this.get('maximumValue') ? parseFloat(this.get('maximumValue')) : 0;
|
|
|
+ return isNaN(max) ? 0 : Math.max(0, max);
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* In slot definitions this value is used to construct the label by appending
|
|
|
* it to slot min-max values. For example giving '%' here would result in slot
|