I try to create shiny app with
rpivotTable
and nvd3 rcharts
all works , but when i try to to show any chart from pivot i get error
An error occurred rendering the PivotTable results.
But if i use only rpivotTable
charts works in pivot and i think that there is problem when using rpivotTable
and nvd3 rcharts
in one shiny app.
Example
UI
library(shiny)
library(rCharts)
library(rpivotTable)
shinyUI(fluidPage(
showOutput('plot1',lib = "nvd3"),
rpivotTableOutput('pivot1', width = "100%", height = "500px"))
)
Server
library(shiny)
library(rCharts)
library(rpivotTable)
df=data.frame(A=c(1:10),B=c(-10:-1),C=c("x",rep(c("x","y","z"),3)))
shinyServer(function(input, output, session) {
output$pivot1 <- renderRpivotTable({
rpivotTable(data =df ,
width="100%", height="500px")
})
output$plot1=renderChart2({
myform <- as.formula(paste('A','~','B'))
n2 <- nPlot(myform, group ="C", data = df, type = 'multiBarChart')
n2$chart(margin = list(left = 100))
n2$chart(reduceXTicks = F)
n2$set(width = 800, height = 500)
print(n2)
})
})
If i use only rpivotTable
charts in pivot works
When i look at inspect i see
TypeError: a.axisTimeFormat.multi is not a function
at e.i.initParams (c3.min.js:1)
at e.i.init (c3.min.js:1)
at new d (c3.min.js:1)
at Object.k.generate (c3.min.js:1)
at Object.renderer (c3_renderers.coffee:129)
at t.fn.pivot (pivot.coffee:546)
at pivot.coffee:835
Is there way to fix it?
Package versions :
rpivotTable_0.1.5.7
rCharts_0.4.2
shiny_0.12.2.9005
Thanks!