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
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
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.