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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
ChrisWilliams
Advocate II
Advocate II

Power BI Tooltips for non-D3 custom visuals

I've created a variety of custom visuals that are all html/typescript (i.e. not using D3).

 

Is anyone aware of whether I can support tool tips in these visuals?  All of the examples I've seen use D3 selectors and rendering.

 

Thanks

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi @ChrisWilliams,

You absolutely can manage tooltips wihtout using D3; it's just that the powerbi-visuals-utils-tooltiputils library provided by MS is dependent on it (this library simplifies the handling of tooltips for folks using D3).

The visual host services (available when the visual is initialised) has a tooltipService property that gives you access to the API, so if you grab this and store it somewhere, you can use it later on in your visual's lifecycle.

While the MS docs try to steer you towards using the tooltip utils, the first paragraph of the linked article provides the implementation of the tooltip service and all the methods you need (.show(), .move() & .hide()).

The difference from powerbi-visuals-utils-tooltiputils is that you need to invoke the events yourself based on mouseover/move/out events on the element(s) you want to access. You will also need to handle passing the data through to the handler, including an appropriate selection ID for report page (or modern) tooltips, if you need them. But, as long as you have these to hand, you don't need D3.

If you need a "real-world" example, Deneb's tooltip handling is all done through the host services rather than the tooltip utils library). It does use D3 for a couple of bits around cross-filtering, but this could easily be moved out of D3 and into native JS (D3 just makes it more convenient). I appreciate that Deneb's codebase is pretty huge, but hopefully the linked snippet might give you some confidence that it's possible, and a couple of ideas as to how you might approach.

Good luck!

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)




View solution in original post

2 REPLIES 2
dm-p
Super User
Super User

Hi @ChrisWilliams,

You absolutely can manage tooltips wihtout using D3; it's just that the powerbi-visuals-utils-tooltiputils library provided by MS is dependent on it (this library simplifies the handling of tooltips for folks using D3).

The visual host services (available when the visual is initialised) has a tooltipService property that gives you access to the API, so if you grab this and store it somewhere, you can use it later on in your visual's lifecycle.

While the MS docs try to steer you towards using the tooltip utils, the first paragraph of the linked article provides the implementation of the tooltip service and all the methods you need (.show(), .move() & .hide()).

The difference from powerbi-visuals-utils-tooltiputils is that you need to invoke the events yourself based on mouseover/move/out events on the element(s) you want to access. You will also need to handle passing the data through to the handler, including an appropriate selection ID for report page (or modern) tooltips, if you need them. But, as long as you have these to hand, you don't need D3.

If you need a "real-world" example, Deneb's tooltip handling is all done through the host services rather than the tooltip utils library). It does use D3 for a couple of bits around cross-filtering, but this could easily be moved out of D3 and into native JS (D3 just makes it more convenient). I appreciate that Deneb's codebase is pretty huge, but hopefully the linked snippet might give you some confidence that it's possible, and a couple of ideas as to how you might approach.

Good luck!

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)




Daniel,

 

Thank you very much for your answer.  This is a very complete and well-written answer.  Thanks for taking the time to answer my question!

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors