mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 23:13:52 +08:00
Heatmap: Fix missing/wrong value in heatmap legend (#31430)
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
This commit is contained in:
@ -71,7 +71,7 @@ coreModule.directive('heatmapLegend', () => {
|
|||||||
clearLegend(elem);
|
clearLegend(elem);
|
||||||
if (!_.isEmpty(ctrl.data) && !_.isEmpty(ctrl.data.cards)) {
|
if (!_.isEmpty(ctrl.data) && !_.isEmpty(ctrl.data.cards)) {
|
||||||
const cardStats = ctrl.data.cardStats;
|
const cardStats = ctrl.data.cardStats;
|
||||||
const rangeFrom = _.isNil(panel.color.min) ? Math.min(cardStats.min, 0) : panel.color.min;
|
const rangeFrom = _.isNil(panel.color.min) ? Math.max(cardStats.min, 0) : panel.color.min;
|
||||||
const rangeTo = _.isNil(panel.color.max) ? cardStats.max : panel.color.max;
|
const rangeTo = _.isNil(panel.color.max) ? cardStats.max : panel.color.max;
|
||||||
const maxValue = cardStats.max;
|
const maxValue = cardStats.max;
|
||||||
const minValue = cardStats.min;
|
const minValue = cardStats.min;
|
||||||
|
@ -501,7 +501,7 @@ export class HeatmapRenderer {
|
|||||||
const cardsData = this.data.cards;
|
const cardsData = this.data.cards;
|
||||||
const cardStats = this.data.cardStats;
|
const cardStats = this.data.cardStats;
|
||||||
const maxValueAuto = cardStats.max;
|
const maxValueAuto = cardStats.max;
|
||||||
const minValueAuto = Math.min(cardStats.min, 0);
|
const minValueAuto = Math.max(cardStats.min, 0);
|
||||||
const maxValue = _.isNil(this.panel.color.max) ? maxValueAuto : this.panel.color.max;
|
const maxValue = _.isNil(this.panel.color.max) ? maxValueAuto : this.panel.color.max;
|
||||||
const minValue = _.isNil(this.panel.color.min) ? minValueAuto : this.panel.color.min;
|
const minValue = _.isNil(this.panel.color.min) ? minValueAuto : this.panel.color.min;
|
||||||
const colorScheme: any = _.find(this.ctrl.colorSchemes, {
|
const colorScheme: any = _.find(this.ctrl.colorSchemes, {
|
||||||
|
Reference in New Issue
Block a user