【发布时间】:2015-11-13 14:06:42
【问题描述】:
我尝试用
创建闪亮的应用程序rpivotTable 和 nvd3 rcharts
一切正常,但是当我尝试从枢轴显示任何图表时 我得到错误
An error occurred rendering the PivotTable results.
但如果我只使用 rpivotTable 图表在数据透视表中工作,我认为在一个闪亮的应用程序中使用 rpivotTable 和 nvd3 rcharts 时会出现问题。
示例
用户界面
library(shiny)
library(rCharts)
library(rpivotTable)
shinyUI(fluidPage(
showOutput('plot1',lib = "nvd3"),
rpivotTableOutput('pivot1', width = "100%", height = "500px"))
)
服务器
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)
})
})
如果我在 pivot 作品中只使用 rpivotTable 图表
当我查看检查时,我看到了
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
有办法解决吗?
包版本:
rpivotTable_0.1.5.7
rCharts_0.4.2
shiny_0.12.2.9005
谢谢!
【问题讨论】:
-
我在 JavaScript 中的某个地方知道这个问题,但不知道如何解决它......(添加错误到问题)
标签: r shiny pivot-table rcharts