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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
peterhui50
Helper III
Helper III

leaflet in power bi

Hi,

 

I am using an R visual but it doesn't seem to be working in power bi. Error message indicates that there are no outputs.

 

this is what I have, 

 

i'm hoping to use leaflet to just open a simple world map. I read that I need an output in html, so I've added in the SaveWidget function. I don't know how to get this to display.

 

any help is appreciated !

peterhui50_0-1594661353336.png

 

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi   @peterhui50 ,

 

Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

 Hi, I'm working on a similar viz and after tweeking the code as suggested got the following error:

y154707_0-1645550302012.png

 

But actually, I've just intalled the last version of Pandoc in my notebook. How can activate Pandoc in Power BI to get this viz working?  In RSStudio the viz shows perfect.

 

Regards

 

Hello!

 

I have the very same issue with a leaflet map choropleth.

 

Everything is working fine in R IDE, but I still get this : 

JordanFaget_0-1658937166805.png

However, I installed the latest version of Pandoc via the installr package. I don't know how to make it work in PowerBI desktop, but ideally I require a solution for the online version.

 

Did you find any workaround?

v-xicai
Community Support
Community Support

Hi   @peterhui50 ,

 

Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

v-xicai
Community Support
Community Support

Hi @peterhui50 ,

 

You may change your codes like below.

 

 

library(readxl)

library(leaflet)

library(htmlwidgets)

#read Excel Data

data <- read_excel("pile.xlsx", col_types = c("text","text", "numeric", "numeric"))

#read json

map_data <- geojsonio::geojson_read("foundation.json",what = "sp")

######################################

map <-leaflet(map_data) %>%

addTiles(urlTemplate = "https://mts1.google.com/vt/lyrs=s&hl=en&src=app&x={x}&y={y}&z={z}&s=G", attribution = 'Google') %>%

addPolygons()%>%

addCircleMarkers(lng = data$x, lat = data$y,radius = 3)

map

saveWidget(map,file="foundation.html",selfcontained=TRUE,title = "foundation")

 

 

For references:

 

HTML map using R, Part 1

 

R leaflet - cannot export map - html

 

In addition, you may send email to R-script support for more professional analysis: Power BI R Custom Visuals Support <pbircvsupport@microsoft.com>

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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