mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Visualize] Coloring tooltip in Heatmap is not working for ">= n" values (#124521)
This commit is contained in:
parent
a5b4b822ce
commit
ffeff57f00
1 changed files with 11 additions and 5 deletions
|
@ -286,15 +286,21 @@ export const HeatmapComponent: FC<HeatmapRenderProps> = memo(
|
|||
|
||||
const bands = ranges.map((start, index, array) => {
|
||||
// by default the last range is right-open
|
||||
let end = index === array.length - 1 ? Infinity : array[index + 1];
|
||||
let end = index === array.length - 1 ? Number.POSITIVE_INFINITY : array[index + 1];
|
||||
// if the lastRangeIsRightOpen is set to false, we need to set the last range to the max value
|
||||
if (args.lastRangeIsRightOpen === false) {
|
||||
const lastBand = max === start ? Infinity : endValue;
|
||||
const lastBand = max === start ? Number.POSITIVE_INFINITY : endValue;
|
||||
end = index === array.length - 1 ? lastBand : array[index + 1];
|
||||
}
|
||||
const overwriteArrayIdx = `${metricFormatter.convert(start)} - ${metricFormatter.convert(
|
||||
end
|
||||
)}`;
|
||||
|
||||
let overwriteArrayIdx;
|
||||
|
||||
if (end === Number.POSITIVE_INFINITY) {
|
||||
overwriteArrayIdx = `≥ ${start}`;
|
||||
} else {
|
||||
overwriteArrayIdx = `${metricFormatter.convert(start)} - ${metricFormatter.convert(end)}`;
|
||||
}
|
||||
|
||||
const overwriteColor = overwriteColors?.[overwriteArrayIdx];
|
||||
return {
|
||||
// with the default continuity:above the every range is left-closed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue