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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
A_Cassidy
New Member

Issue with Hover Mode Setting in Custom R Visual Using Plotly on Power BI Service

I'm experiencing an issue with a custom R visual in Power BI, specifically when using Plotly. Once the plot has been created by plotly its saved as an HTML widget using internalSaveWidget. My goal is to set the hover mode to 'closest' for a plot. This setting works as expected in Power BI Desktop. However, when the report is published to the Power BI Service, the plot defaults to the 'CompareCartesian' hover mode instead.

 

I've tried:

  • Setting hovermode = 'closest' in both the layout() and config() functions.
  • Ensuring other settings in the layout are being applied correctly (which they are).

The hover mode still defaults to 'CompareCartesian' every time the visual is refreshed on the Power BI Service. This requires users to manually switch the hover mode back to 'closest' to make the plot useful.

 

I am looking for any possible workarounds or insights into whether this is a known limitation with the Power BI Service. Any suggestions or advice would be greatly appreciated.

 

 

1 ACCEPTED SOLUTION
A_Cassidy
New Member

Thanks for the support, what you say is indeed the case, or at least was until recently. It now seems possible to have user interaction with Custom R visuals using Plotly and saving the plot as an Html widget. By interaction I mean, zoom, pan, tooltips etc, sadly not cross filtering with other page visuals. I have this working now on both Power BI desktop and Power BI Service.

 

Through a long process of trial and error, I finally managed to get the hover mode = 'closet' to be default for both PBI desktop and PBI service.


First step is to complete the initial plot creation, then in a subsequent step, explicitly updated the plot's layout to set the hover mode:


# Initial plot creation
p <- [initial plot creation code]

# Explicitly set the hover mode in the plot's layout
p <- p %>% layout(hovermode = 'closest')

 

Now works in both PBI desktop and when published to the online service.

 

View solution in original post

3 REPLIES 3
A_Cassidy
New Member

Thanks for the support, what you say is indeed the case, or at least was until recently. It now seems possible to have user interaction with Custom R visuals using Plotly and saving the plot as an Html widget. By interaction I mean, zoom, pan, tooltips etc, sadly not cross filtering with other page visuals. I have this working now on both Power BI desktop and Power BI Service.

 

Through a long process of trial and error, I finally managed to get the hover mode = 'closet' to be default for both PBI desktop and PBI service.


First step is to complete the initial plot creation, then in a subsequent step, explicitly updated the plot's layout to set the hover mode:


# Initial plot creation
p <- [initial plot creation code]

# Explicitly set the hover mode in the plot's layout
p <- p %>% layout(hovermode = 'closest')

 

Now works in both PBI desktop and when published to the online service.

 

Anonymous
Not applicable

Hi  @A_Cassidy ,

 

R visuals are refreshed upon data updates, filtering, and highlighting. However, the image itself isn't interactive and doesn't support tool tips.

R visuals respond to highlighting other visuals, but you can't select elements in the R visual in order to cross filter other elements.

 

Create advanced analytics and visualizations using R scripts - Power BI | Microsoft Learn

 

Best regards.
Community Support Team_Caitlyn

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.