From dc3dc215d80ee5caed69318d2e6f7662623e5707 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Fri, 18 Feb 2022 09:49:48 +0000 Subject: [PATCH] Chore: avoid pointer events in viz tooltip (#45492) (#45494) (cherry picked from commit 685ec5383eb716ef6c7c4dc6b9c17545a1dd9ba3) Co-authored-by: Ryan McKinley --- .../src/components/VizTooltip/VizTooltipContainer.tsx | 2 +- public/app/plugins/panel/barchart/BarChartPanel.tsx | 2 +- public/app/plugins/panel/xychart/scatter.ts | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/grafana-ui/src/components/VizTooltip/VizTooltipContainer.tsx b/packages/grafana-ui/src/components/VizTooltip/VizTooltipContainer.tsx index 48dad2789eb..96e6a506413 100644 --- a/packages/grafana-ui/src/components/VizTooltip/VizTooltipContainer.tsx +++ b/packages/grafana-ui/src/components/VizTooltip/VizTooltipContainer.tsx @@ -23,7 +23,7 @@ export const VizTooltipContainer: React.FC = ({ position: { x: positionX, y: positionY }, offset: { x: offsetX, y: offsetY }, children, - allowPointerEvents, + allowPointerEvents = false, className, ...otherProps }) => { diff --git a/public/app/plugins/panel/barchart/BarChartPanel.tsx b/public/app/plugins/panel/barchart/BarChartPanel.tsx index 8820d009485..7a4e7dc5f2c 100755 --- a/public/app/plugins/panel/barchart/BarChartPanel.tsx +++ b/public/app/plugins/panel/barchart/BarChartPanel.tsx @@ -271,7 +271,7 @@ export const BarChartPanel: React.FunctionComponent = ({ data, options, w {renderTooltip(info.aligned, focusedSeriesIdx, focusedPointIdx)} diff --git a/public/app/plugins/panel/xychart/scatter.ts b/public/app/plugins/panel/xychart/scatter.ts index 6c96b244798..5830c75b414 100644 --- a/public/app/plugins/panel/xychart/scatter.ts +++ b/public/app/plugins/panel/xychart/scatter.ts @@ -328,11 +328,8 @@ const prepConfig = ( let deg360 = 2 * Math.PI; - // leon forgot to add these to the uPlot's Scale interface, but they exist! - //let xKey = scaleX.key as string; - //let yKey = scaleY.key as string; - let xKey = series.facets![0].scale; - let yKey = series.facets![1].scale; + let xKey = scaleX.key!; + let yKey = scaleY.key!; let pointHints = scatterInfo.hints.pointSize; const colorByValue = scatterInfo.hints.pointColor.mode.isByValue;