Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
gatapia
Frequent Visitor

Custom Visual Displayed inside a Tooltip - Listen to Visibility Change

I have a Custom Visual that I want to display in a tooltip (Report Page Tooltip) but I need to know when the tooltip is shown (i.e. when the Custom Visual becomes visible).  Is there any event I can listen to for this?

 

I have tried attaching a MutationObserver on the visua's element but this does not get fired. 

 

1 REPLY 1
dm-p
Super User
Super User

Hi @gatapia,

Visuals are heavily sandboxed, so you're likely to only be able to do anything from inside.

When a tooltip is created, Power BI will initialise a visual, and at this point, your constructor method's code will execute. Note that this is exactly the same as if your visual is created on a page, or when a page containing your visual is navigated to.

The visual APIs do supply a CustomVisualHostEnv property via the IVisualHost (options.host in the constructor call, or options.host.hostEnv for the full property). However, there is no value for detecting whether the visual has been opened as a tooltip; I would expect that as report page tooltips are the same as report pages, Power BI will report its host environment as it normally would.

Another approach might be to inspect the hostCapabilities.allowInteractions object, which is typically set to false if the visual is displayed in a context that you should prohibit interactivit..., e.g. in a dashboard tile. I can't be 100% positive if this will be false if displayed in a tooltip, but it might give you what you want to achieve.

Failing that, you may need to raise an issue with the team to request an API that specifically gives you what you ...

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.