【发布时间】:2015-05-12 14:37:42
【问题描述】:
在我升级到 rCharts 版本 0.4.5 后,我无法再在我的 rmarkdown 文件中看到绘图了。我已经制作了一个最小的示例 rmd,我再也看不到这些图了(如果我在浏览器中打开输出)。我完全不知道哪个包对此负责。请注意,如果我使用 $save 模式并只导入创建的 html 文件,如示例 2 所示,它工作正常。
你有什么想法吗?
我从一个 highcharts 演示中创建了一个最小示例。 This thread 也帮了我。
```{r echo = F, message = F, cache = F}
# Set options for plots.
library(knitr)
opts_chunk$set(results = 'asis', comment = NA, message = F, tidy = F, echo=FALSE, cache=FALSE)
```
```{r, echo=FALSE}
library(rCharts)
a <- hPlot(Pulse ~ Height, data = MASS::survey, type = "bubble", title = "Zoom demo", subtitle = "bubble chart", size = "Age", group = "Exer")
a$chart(zoomType = "x")
a$exporting(enabled = T)
a$show('iframesrc', cdn = TRUE)
```
```{r, echo=FALSE}
library(rCharts)
a <- hPlot(Pulse ~ Height, data = MASS::survey, type = "bubble", title = "Zoom demo", subtitle = "bubble chart 2", size = "Age", group = "Exer")
a$chart(zoomType = "x")
a$exporting(enabled = T)
a$save('plot2.html', standalone = TRUE)
```
<iframe src="plot2.html" height="450" width="850" frameBorder="0"></iframe>
【问题讨论】: