I tried to trigger the tooltip for a specific entry in a google chart when coming from a link from an external URL.
const urlParams = new URLSearchParams(window.location.search);
const showTooltip = urlParams.get('showTooltip');
if (showTooltip) {
google.visualization.events.addListener(scatterChart, 'ready', function() {
setTimeout(() => {
showTooltipForEntry(showTooltip);
}, 1000);
});
}
function showTooltipForEntry(entryName) {
const rowIndex = data.getFilteredRows([{column: 1, value: entryName}])[0];
if (rowIndex === undefined) return; // If no matching row, exit
scatterChart.getChart().setSelection([{row: rowIndex, column: null}]);
}
The tooltip should show with the following URL: http://example.com/page?showTooltip=Identifier
The data point in the chart is selected, but the tooltip doesn´t show. The trigger for the tooltip is set to “both”. Any ideas on how to fix this?