Barchart: Fix tooltip for normal/percentage stacking(2) (#69956)

pull/70029/head
Adela Almasan 2 years ago committed by GitHub
parent feb2b5878b
commit 9e198ba745
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      public/app/plugins/panel/barchart/bars.ts

@ -493,13 +493,15 @@ export function getConfig(opts: BarsOptions, theme: GrafanaTheme2) {
let heightReduce = 0;
let widthReduce = 0;
const rect = hRect && findRect(qt, hRect.sidx - 1, hRect.didx);
// get height of bar rect at same index of the series below the hovered one
if (isStacked && isHovered && hRect!.sidx > 1 && rect) {
if (isXHorizontal) {
heightReduce = rect.h;
} else {
widthReduce = rect.w;
if (isStacked && isHovered) {
const rect = hRect && hRect.sidx > 1 && findRect(qt, hRect.sidx - 1, hRect.didx);
if (rect) {
if (isXHorizontal) {
heightReduce = rect.h;
} else {
widthReduce = rect.w;
}
}
}

Loading…
Cancel
Save