Change dynamic text annotations on hover event info

  • Goal: Its possible to change the text of annotations on hover event value ?

  • Steps: I have created a donut chart .I want to show the dynamic text on the centre of donut chart wrt hover event value on chart

1 Like

Hello and welcome to the forums!

I think, based on the reference docs, that you could to make use of the customdata property of your chart data to give each datum the annotation required for display. Per plotly's docs this seems to be useful when needing to make use of the hover events.

Here's the full reference page for Hover Events

1 Like

Hi
Thanks,
In retool,

I am not able to call document.getElementsByClassName or document.getElementByID under resource query

var myPlot = document.getElementById('myDiv'),
hoverInfo = document.getElementById('hoverinfo'),

this is not working for me.

Please help

Hi @mishra, in Retool, DOM methods are whitelisted. The only way to interact with the chart is by using Plotly. Here is an example of something similar to your use case: