cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Adding tooltips to a custom visual

Hi,

 

I would like to add tooltips to a custom visualization I am currently working on. i have been reading:

 

https://github.com/Microsoft/powerbi-visuals-utils-tooltiputils/blob/master/docs/api/tooltipservice....

 

But It seems to me the tooltipservice has a dependency to the d3 library, but my visualization doesn't use d3, it's more like an advanced label.

 

interface ITooltipServiceWrapper {
    addTooltip<T>(selection: d3.Selection<any>, getTooltipInfoDelegate: (args: TooltipEventArgs<T>) => VisualTooltipDataItem[], getDataPointIdentity?: (args: TooltipEventArgs<T>) => ISelectionId, reloadTooltipDataOnMouseMove?: boolean): void;
    hide(): void;
}

 

Can I use the Tooltipservice without d3? If so can you pintpoint me to a basic example of adding tooltips to a visualization without d3?

 

Kind regards Erik

  

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Adding tooltips to a custom visual

We don't have any basic sample but we would recommend to take a look at how TooltipUtils work with TooltipService directly.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

3 REPLIES 3
Highlighted
Community Champion
Community Champion

Re: Adding tooltips to a custom visual

Hi @erikito,

 

You're right. TooltipService from TooltipUtils depends on d3v3.

Tooltip API can be used directly by firing move, show, hide methods of internal TooltipService.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Highlighted
Regular Visitor

Re: Adding tooltips to a custom visual

Thanks, is there any sample code available that shows ho to call these methods directly from a custom visual?

Highlighted
Community Champion
Community Champion

Re: Adding tooltips to a custom visual

We don't have any basic sample but we would recommend to take a look at how TooltipUtils work with TooltipService directly.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors