From 3747e7240606f685d8a3e544faba8928fde0f6ca Mon Sep 17 00:00:00 2001 From: Lucas Demenais Date: Mon, 7 Oct 2024 10:37:06 +0200 Subject: [PATCH] fix: x hoverlabel hidden with hoversubplots axis --- src/components/fx/hover.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/fx/hover.js b/src/components/fx/hover.js index 98a8af61aa7..3b1ab6717c9 100644 --- a/src/components/fx/hover.js +++ b/src/components/fx/hover.js @@ -1087,7 +1087,17 @@ function createHoverText(hoverData, opts) { (outerTop - tbb.top + HOVERARROWSIZE + HOVERTEXTPAD))); lx = xa._offset + (c0.x0 + c0.x1) / 2; - ly = ya._offset + (xa.side === 'top' ? 0 : ya._length); + + // show the common label at the bottom subplot if hoversubplots is set to axis + if (fullLayout.hoversubplots === 'axis') + { + var bottom_ya = fullLayout._plots.xy.yaxis; + ly = bottom_ya._offset + (xa.side === 'top' ? 0 : bottom_ya._length); + } + else + { + ly = ya._offset + (xa.side === 'top' ? 0 : ya._length); + } var halfWidth = tbb.width / 2 + HOVERTEXTPAD;