R FlexDashboard ggiraph chart not showing on second page of dashboard when using IE 11

橙三吉。 提交于 2019-12-12 04:31:14

问题


I have a multi-page R FlexdashBoard and I am trying to use ggiraph to create some interactive charts. They show up fine on the first page of the dashboard, however on the second page the SVG graphics do not show up until I hit refresh then the charts on the first page disappear. Also the text in the SVG graphics seems to only display intermittently. I only have this error in Internet Explorer - everything works fine in Chrome. The following code should recreate this error.

Any help would be greatly appreciated event a hint on which package or piece of java script to look at.

---
title: "Please Help Me!"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---

```{r setup, include=FALSE}
library(flexdashboard)
library(ggplot2)
library(ggiraph)
```

Works {data-orientation=rows}
=====================================  

Column {data-width=650}
-----------------------------------------------------------------------

### Chart A

```{r}
myIris <- iris
myIris$DataId<- row.names(iris)
g2 <- ggplot(data=myIris, aes(x=Sepal.Length, y=Sepal.Width, data_id=DataId)) + geom_point_interactive(fill = "green", alpha=.5)
ggiraph(code = print(g2), width_svg = 8, height_svg=4,
        hover_css="fill-opacity:1",flexdashboard =TRUE)

```

Column {data-width=350}
-----------------------------------------------------------------------

### Chart B

```{r}

myIris <- iris
myIris$DataId<- row.names(iris)
g2 <- ggplot(data=myIris, aes(x=Sepal.Length, y=Sepal.Width, data_id=DataId)) + geom_point_interactive(fill = "green", alpha=.5)
ggiraph(code = print(g2), width_svg = 8, height_svg=4,
        hover_css="fill-opacity:1",flexdashboard =TRUE)
```

### Chart C

```{r}
myIris <- iris
myIris$DataId<- row.names(iris)
g2 <- ggplot(data=myIris, aes(x=Sepal.Length, y=Sepal.Width, data_id=DataId)) + geom_point_interactive(fill = "green", alpha=.5)
ggiraph(code = print(g2), width_svg = 8, height_svg=4,
        hover_css="fill-opacity:1",flexdashboard =TRUE)

```

Does Not Work {data-orientation=rows}
=====================================  

### Chart C

```{r}
myIris <- iris
myIris$DataId<- row.names(iris)
g2 <- ggplot(data=myIris, aes(x=Sepal.Length, y=Sepal.Width, data_id=DataId)) + geom_point_interactive(fill = "green", alpha=.5)
ggiraph(code = print(g2), width_svg = 8, height_svg=4,
        hover_css="fill-opacity:1",flexdashboard =TRUE)

```

### Chart D

```{r}
myIris <- iris
myIris$DataId<- row.names(iris)
g2 <- ggplot(data=myIris, aes(x=Sepal.Length, y=Sepal.Width, data_id=DataId)) + geom_point_interactive(fill = "green", alpha=.5)
ggiraph(code = print(g2), width_svg = 8, height_svg=4,
        hover_css="fill-opacity:1",flexdashboard =TRUE)

```
### Chart E

```{r}
myIris <- iris
myIris$DataId<- row.names(iris)
g2 <- ggplot(data=myIris, aes(x=Sepal.Length, y=Sepal.Width, data_id=DataId)) + geom_point_interactive(fill = "green", alpha=.5)
ggiraph(code = print(g2), width_svg = 8, height_svg=4,
        hover_css="fill-opacity:1",flexdashboard =TRUE)

```

来源:https://stackoverflow.com/questions/43150055/r-flexdashboard-ggiraph-chart-not-showing-on-second-page-of-dashboard-when-using

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!