将本地图表图形嵌入到本地html页面

时间:2017-02-11 17:16:38

标签: javascript html r plotly google-earth

我使用R中的Plotly库生成了一个交互式图形,另一个使用雷达图包,然后将它们插入到本地html页面中,在Google Earth Pro程序中,雷达图显示在属性页面中但是图形图表没有秀...我不知道为什么,所以有什么帮助吗?我花了很多时间寻找解决方案,却找不到任何解决方案。

这是我的情节图“DailyData”的数据

structure(list(Day = c("Saturday", "Saturday", "Saturday", "Sunday", 
"Sunday", "Sunday", "Monday", "Monday", "Monday", "Tuesday", 
"Tuesday", "Tuesday", "Wednesday", "Wednesday", "Wednesday", 
"Thursday", "Thursday", "Thursday", "Friday", "Friday", "Friday"
), Type = structure(c(1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 
2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L), .Label = c("Accidents", 
"Fatalities", "Injuries"), class = "factor"), No. = c(66, 6, 
73, 61, 26, 117, 54, 6, 70, 57, 21, 47, 53, 10, 48, 69, 23, 80, 
52, 5, 38)), .Names = c("Day", "Type", "No."), row.names = c("1", 
"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", 
"14", "15", "16", "17", "18", "19", "20", "21"), class = "data.frame")

,这是代码

  R2 <- ggplot()+geom_bar(data=DailyData,aes(x=reorder(Day,as.single(row.names(DailyData))),y=No.,group = as.factor(Type),fill=Type),stat = "identity",position = "dodge")+
            labs(x="Day")
    R2 <- ggplotly(R2,tooltip = c("No.","Type"))
    R2name <- paste0(name,"Daily.html")
    saveWidget(R2,R2name) 

这是照片显示我的意思

照片显示google earth pro本地html页面中的雷达图 enter image description here

照片显示情节图未出现在html页面中 enter image description here

这张照片显示了我用于这两者的 HTML代码enter image description here

这是代码

<iframe src="file:Graphs/Cairo_Assiut(WestRd)Radar.html" width="960" height="500" scrolling="no" seamless="seamless"></iframe>

<iframe src="file:Graphs/Cairo_Assiut(WestRd)Daily.html" width="960" height="500" scrolling="no" seamless="seamless"></iframe>

我的阴谋图表的html代码是否有错误?这是第二个代码?请帮忙

0 个答案:

没有答案