3

I am using rChart library for generating javascript plots directly from R statistical package. I am trying to compute multiBarChart but the plot seems to be blank.

EDIT What is more, none of examples from here displays on my computer: https://github.com/ramnathv/rCharts/blob/master/inst/libraries/nvd3/examples.R all examples are blank. Also some1 has a similar problem here and refers maybe to proxy:https://github.com/ramnathv/rCharts/issues/624 .

This code worked for my on my other computer.

Any idea on what's going on and how to fix this?

Objects to reproduce this bug:

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

And a barchart itself

 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

My session info is

> 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
Marcin
  • 7,834
  • 8
  • 52
  • 99
  • what is `input$type`? If you just want a `multiBarChart`, try `type="multiBarChart"` – NicE May 13 '15 at 15:33
  • Sory, this comes from input from shiny app I am building. It looks like all examples from here are blank on my computer https://github.com/ramnathv/rCharts/blob/master/inst/libraries/nvd3/examples.R – Marcin May 13 '15 at 16:14

4 Answers4

0

I have the same issue. I can't view in browser unless I save it as an html file.

Try this:

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

Also, taking it a step further to shiny, see this example:

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

Use renderChart2 instead of renderChart, though.

Jeremy Pastore
  • 323
  • 1
  • 3
  • 5
  • I used a lot of explanations from issues from their github repo and none of them worked unless I saved it with cdn=FALSE. https://github.com/ramnathv/rCharts/issues renderChart2 doesn't seem to help. I've changed system ffrom ubuntu to windows and it worked ;] – Marcin May 15 '15 at 15:07
0

Looks like this example in shiny works on every localization:

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

Marcin
  • 7,834
  • 8
  • 52
  • 99
0

Looking here i got the solution

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)
Sergio
  • 714
  • 1
  • 8
  • 24
-1

Try this

 n1$addParams(dom = "myChart", "nvd3")
adibender
  • 7,288
  • 3
  • 37
  • 41