mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
fixing custom range options
This commit is contained in:
parent
3fbb3f7480
commit
644453de19
3 changed files with 17 additions and 10 deletions
|
@ -116,7 +116,7 @@
|
|||
type="number"
|
||||
class="form-control"
|
||||
name="range.from"
|
||||
greater-than="{{getGreaterThan($index)}}"
|
||||
greater-or-equal-than="{{getGreaterThan($index)}}"
|
||||
step="any" />
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
@ -8,6 +8,7 @@ function makeDirectiveDef(id, compare) {
|
|||
const getBound = function () { return $parse($attr[id])(); };
|
||||
const defaultVal = {
|
||||
'greaterThan': -Infinity,
|
||||
'greaterOrEqualThan': -Infinity,
|
||||
'lessThan': Infinity
|
||||
}[id];
|
||||
|
||||
|
@ -36,4 +37,7 @@ uiModules
|
|||
}))
|
||||
.directive('lessThan', makeDirectiveDef('lessThan', function (a, b) {
|
||||
return a < b;
|
||||
}))
|
||||
.directive('greaterOrEqualThan', makeDirectiveDef('greaterOrEqualThan', function (a, b) {
|
||||
return a >= b;
|
||||
}));
|
||||
|
|
|
@ -47,14 +47,15 @@ export default function HeatmapChartFactory(Private) {
|
|||
const zScale = this.getValueAxis().getScale();
|
||||
const [min, max] = zScale.domain();
|
||||
const labels = [];
|
||||
for (let i = 0; i < colorsNumber; i++) {
|
||||
let label;
|
||||
|
||||
if (cfg.get('setColorRange')) {
|
||||
const from = colorsRange[i].from;
|
||||
const to = colorsRange[i].to;
|
||||
label = `${from} - ${to}`;
|
||||
} else {
|
||||
if (cfg.get('setColorRange')) {
|
||||
colorsRange.forEach(range => {
|
||||
const from = range.from;
|
||||
const to = range.to;
|
||||
labels.push(`${from} - ${to}`);
|
||||
});
|
||||
} else {
|
||||
for (let i = 0; i < colorsNumber; i++) {
|
||||
let label;
|
||||
let val = i / colorsNumber;
|
||||
let nextVal = (i + 1) / colorsNumber;
|
||||
if (percentageMode) {
|
||||
|
@ -70,9 +71,11 @@ export default function HeatmapChartFactory(Private) {
|
|||
}
|
||||
label = `${val} - ${nextVal}`;
|
||||
}
|
||||
|
||||
labels.push(label);
|
||||
}
|
||||
labels.push(label);
|
||||
}
|
||||
|
||||
return labels;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue