Commit ae3d2598 by sv5d Committed by Marcus Efraimsson

Heatmap: Legend color range is incorrect when using custom min/max (#21748)

Fix opacity and color scales initializations which took wrong range 
arguments (current data min/max instead of custom range min/max).

Fixes #18139
parent e95bcc4b
...@@ -109,7 +109,7 @@ function drawColorLegend( ...@@ -109,7 +109,7 @@ function drawColorLegend(
const widthFactor = legendWidth / (rangeTo - rangeFrom); const widthFactor = legendWidth / (rangeTo - rangeFrom);
const valuesRange = d3.range(rangeFrom, rangeTo, rangeStep); const valuesRange = d3.range(rangeFrom, rangeTo, rangeStep);
const colorScale = getColorScale(colorScheme, contextSrv.user.lightTheme, maxValue, minValue); const colorScale = getColorScale(colorScheme, contextSrv.user.lightTheme, rangeTo, rangeFrom);
legend legend
.append('g') .append('g')
.attr('class', 'legend-color-bar') .attr('class', 'legend-color-bar')
...@@ -147,7 +147,7 @@ function drawOpacityLegend( ...@@ -147,7 +147,7 @@ function drawOpacityLegend(
const widthFactor = legendWidth / (rangeTo - rangeFrom); const widthFactor = legendWidth / (rangeTo - rangeFrom);
const valuesRange = d3.range(rangeFrom, rangeTo, rangeStep); const valuesRange = d3.range(rangeFrom, rangeTo, rangeStep);
const opacityScale = getOpacityScale(options, maxValue, minValue); const opacityScale = getOpacityScale(options, rangeTo, rangeFrom);
legend legend
.append('g') .append('g')
.attr('class', 'legend-color-bar') .attr('class', 'legend-color-bar')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment