【问题标题】:multiBarChart (nvd3) in rCharts is not displayingrCharts 中的 multiBarChart (nvd3) 未显示
【发布时间】:2015-05-13 11:47:56
【问题描述】:

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

编辑 更重要的是,这里的示例都没有显示在我的计算机上: 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

【问题讨论】:

标签: javascript r bar-chart rcharts


【解决方案1】:

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

试试这个:

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

另外,更进一步的闪亮,看这个例子:

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

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

【讨论】:

  • 我从他们的 github repo 中的问题中使用了很多解释,除非我用 cdn=FALSE 保存它,否则它们都不起作用。 github.com/ramnathv/rCharts/issues renderChart2 似乎没有帮助。我已将系统从 ubuntu 更改为 windows 并且可以正常工作;]
【解决方案2】:

在每个本地化的闪亮作品中看起来都像这个例子:

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

【讨论】:

    【解决方案3】:

    寻找here我得到了解决方案

    嵌入选项 1:Iframe 内联第一个选项是嵌入图表 作为内联 iframe。它具有保留html的优点 独立的,但将图表与页面上的 html 隔离,从而 避免 css 和 js 冲突。但是,不支持此功能 通过 IE 和 Opera。

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

    【讨论】:

      【解决方案4】:

      试试这个

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-11-28
        • 1970-01-01
        相关资源
        最近更新 更多