Forum Discussion
PLOTLY Scatter plot using R in POWER BI
Hi,
I have the following dataset.
Hi bobbob123 ,
Sorry to reply so late. Plotly lib is supported as part of HTML support for R powered Custom Visuals only, not R Visuals in general currently.
Plotly can only be used if it produces an IMAGE\PNG for R visuals in PBI. Not HTML.
If you want to create interactive visualizations using plotly. The only way you can do is to create a custom Power BI visualization and import it to your report. See these posts for a good introduction.
Interactive Charts using R and Power BI: Create Custom Visual Part 1
Interactive Charts using R and Power BI: Create Custom Visual Part 2
How to create R custom visual (html) in PowerBI
And this is my test.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- v-kkf-msftCommunity Support
Hi bobbob123 ,
The most current version of R supported on both Power BI Desktop and the Power BI service is version 3.4.4.
And please try the code:
library(plotly) plot_ly(data = dataset, x = ~SA, y = ~HM, type = "scatter", mode = "markers", color =~S)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- bobbob123Helper III
This is what I get.
Error Message:
R script error.
Loading required package: ggplot2Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
Warning message:
replacing previous import 'vctrs::data_frame' by 'tibble::data_frame' when loading 'dplyr'
Error: unexpected symbol in "plot_ly(data = dataset, x = ~SA"
Execution halted- v-kkf-msftCommunity Support
Hi bobbob123 ,
Sorry to reply so late. Plotly lib is supported as part of HTML support for R powered Custom Visuals only, not R Visuals in general currently.
Plotly can only be used if it produces an IMAGE\PNG for R visuals in PBI. Not HTML.
If you want to create interactive visualizations using plotly. The only way you can do is to create a custom Power BI visualization and import it to your report. See these posts for a good introduction.
Interactive Charts using R and Power BI: Create Custom Visual Part 1
Interactive Charts using R and Power BI: Create Custom Visual Part 2
How to create R custom visual (html) in PowerBI
And this is my test.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.