rCharts 中的 multiBarChart (nvd3) 未显示

multiBarChart (nvd3) in rCharts is not displaying

我正在使用 rChart 库直接从 R 统计包生成 javascript 图。我正在尝试计算 multiBarChart 但情节似乎是空白的。

编辑 更重要的是,none 这里的例子显示在我的电脑上: https://github.com/ramnathv/rCharts/blob/master/inst/libraries/nvd3/examples.R 所有的例子都是空白的。 some1 在这里也有类似的问题,可能指的是 proxy:https://github.com/ramnathv/rCharts/issues/624 .

此代码适用于我的另一台计算机。

知道发生了什么以及如何解决这个问题吗?

重现此错误的对象:

WhoAndWhere2Viz <- loadFromGithubRepo("cb754ba1e5b9542cdf982d1491c07099",
                   repo = "Museum",
                   user = "MarcinKosinski",
                   value =TRUE )

还有条形图本身

 library(rCharts)
 n1 <- nPlot( count ~ domena, group = "kto", data = WhoAndWhere2Viz,
                    type="multiBarChart")
       n1$addParams(dom = "myChart")
       n1$chart(color = c('brown', '#594c26', 'blue',  'green'))
 n1

我的会话信息是

> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.2 LTS

locale:
 [1] LC_CTYPE=pl_PL.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=pl_PL.UTF-8        LC_COLLATE=pl_PL.UTF-8    
 [5] LC_MONETARY=pl_PL.UTF-8    LC_MESSAGES=pl_PL.UTF-8   
 [7] LC_PAPER=pl_PL.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=pl_PL.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

loaded via a namespace (and not attached):
[1] tools_3.2.0

我有同样的问题。我无法在浏览器中查看,除非我将其另存为 html 文件。

试试这个:

   n1$save('test.html', cdn=FALSE)

另外,为了闪亮更进一步,请看这个例子:

https://gist.github.com/ramnathv/5531732

不过,请使用 renderChart2 而不是 renderChart。

看起来像这个闪亮的示例适用于每个本地化:

https://gist.github.com/ramnathv/5531732

寻找 here 我得到了解决方案

Embed Option 1: Iframe Inline This first option is to embed the chart as an inline iframe. It has the advantage of keeping the html standalone, but isolating the chart from the html on the page, thereby avoiding css and js conflicts. However, this feature is not supported by IE and Opera.

n1$show('iframesrc', cdn = FALSE)

试试这个

 n1$addParams(dom = "myChart", "nvd3")