Skip to content

Commit 7c1e809

Browse files
[TSVB] Show tooltip on external pointer events (#77306)
* Show external pointer events in TSVB * Disable tooltip visibility Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
1 parent 43495d8 commit 7c1e809

File tree

1 file changed

+8
-6
lines changed
  • src/plugins/vis_type_timeseries/public/application/visualizations/views/timeseries

1 file changed

+8
-6
lines changed

src/plugins/vis_type_timeseries/public/application/visualizations/views/timeseries/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,20 @@ export const TimeSeries = ({
7070
annotations,
7171
}) => {
7272
const chartRef = useRef();
73-
const updateCursor = (_, cursor) => {
74-
if (chartRef.current) {
75-
chartRef.current.dispatchExternalPointerEvent(cursor);
76-
}
77-
};
7873

7974
useEffect(() => {
75+
const updateCursor = (_, cursor) => {
76+
if (chartRef.current) {
77+
chartRef.current.dispatchExternalPointerEvent(cursor);
78+
}
79+
};
80+
8081
eventBus.on(ACTIVE_CURSOR, updateCursor);
8182

8283
return () => {
8384
eventBus.off(ACTIVE_CURSOR, undefined, updateCursor);
8485
};
85-
}, []); // eslint-disable-line
86+
}, []);
8687

8788
const tooltipFormatter = decorateFormatter(xAxisFormatter);
8889
const uiSettings = getUISettings();
@@ -139,6 +140,7 @@ export const TimeSeries = ({
139140
type: tooltipMode === 'show_focused' ? TooltipType.Follow : TooltipType.VerticalCursor,
140141
headerFormatter: tooltipFormatter,
141142
}}
143+
externalPointerEvents={{ tooltip: { visible: false } }}
142144
/>
143145

144146
{annotations.map(({ id, data, icon, color }) => {

0 commit comments

Comments
 (0)