2

I am creating a custom visual for power bi using rcharts but when it goes for saving the widget it say returns me an error. This is my code:

source('./r_files/flatten_HTML.r')
libraryRequireInstall("plotly")
library(rCharts)

library(fmsb)
library(plyr)
library(dplyr)
library(reshape2)
library(RColorBrewer)

dataset = Values

dataset$Nome <- as.factor(dataset$Nome)

dataset$TesteExercise <- as.factor(dataset$TesteExercise)

dataset$PlayerPosition <- as.factor(dataset$PlayerPosition)

pospassmatrix1 <- dataset %>%

  group_by(TesteExercise) %>%
  summarise(ValueTotal1 = sum(Value))

pospassmatrix2 <- dataset %>% 
  group_by(PlayerPosition) %>%
  summarise(ValueTotal2 = sum(Value))

plot <- Highcharts$new()
plot$chart(polar = TRUE, type = "line",height=500)
plot$xAxis(categories=pospassmatrix1$TesteExercise, tickmarkPlacement= 'on', lineWidth= 0)
plot$yAxis(gridLineInterpolation='circle', lineWidth= 0,endOnTick=T,tickInterval=10)

plot$series(data = pospassmatrix1$ValueTotal1,name = "sum1", pointPlacement="on")
plot$series(data = pospassmatrix2$ValueTotal2,name = "sum2", pointPlacement="on")


####################################################
p = plot
############# Create and save widget ###############
internalSaveWidget(p, 'out.html');
####################################################

Anyone has a clue of how I can use rchart graphs as a widget or transform this in a ggplot adaptation ?

pbi error

Prradep
  • 5,506
  • 5
  • 43
  • 84

0 Answers0