无法从打印的html文件中查看gvisMotionChart [英] Cannot view gvisMotionChart from printed html file
问题描述
当我将运动图表的代码保存到html文件并尝试打开它时,我看到页脚,初始化进度条瞬间闪烁,但没有出现其他内容。
b$ b
所以
M1 < - gvisMotionChart(Fruits,idvar =Fruit,timevar =Year)
plot(M1)
很好,但
print(M1,file ='d:/delete/fruit.html')
,然后在浏览器中打开生成的文件会变为空白(除了页脚)。有没有一种方法可以保存这种可视化效果,并将其传播?
据我了解,该文件必须显示通过网络服务器显示图表
http://code.google.com/apis/chart/interactive/docs/gallery/motionchart.html#Notes
由于Flash安全设置,从浏览器中的文件
位置访问时,此(以及所有基于Flash的
可视化)可能无法正常工作(例如, file:/// c:/webhost/myhost/myviz.html)
而不是来自Web服务器的URL(例如,
http://www.myhost.com/myviz.html )。这通常只是一个测试问题
。您可以按照Macromedia Web
站点上的描述来解决此问题。
R中的plot命令使用内部R http帮助服务器克服这个限制。
以下是我如何克服它: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.htmlrel =noreferrer> http://www.macromedia.com/support/documentation/en/flashplayer/help/ settings_manager04.html
现在打开您的googleVis html文件,它应该显示成功。实际上,您从所选文件夹中打开的任何googleVis文件也会按照您的预期显示。
When I save the code for a Motion Chart into an html file and try to open it, I get the footer and the "initializing" progress bar blinks for a split second, but nothing else shows up.
so
M1 <- gvisMotionChart(Fruits, idvar="Fruit", timevar="Year")
plot(M1)
works great, but
print(M1, file='d:/delete/fruit.html')
and then opening the resulting file in a browser comes up blank (except for the footer). Is there a way I can save this visualization and circulate it around?
As I understand it, the file has to be displayed via a web server to show the chart
http://code.google.com/apis/chart/interactive/docs/gallery/motionchart.html#Notes
Because of Flash security settings, this (and all Flash-based visualizations) might not work correctly when accessed from a file location in the browser (e.g., file:///c:/webhost/myhost/myviz.html) rather than from a web server URL (e.g., http://www.myhost.com/myviz.html). This is typically a testing issue only. You can overcome this issue as described on the Macromedia web site.
The plot command in R uses the internal R http help server to overcome this limitation.
Here's how I overcame it:
- Go to http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
- Click on the dropbox which says 'Edit location' and choose 'add location'
- Click 'browse for folder'
- Choose the folder in which you saved your html file
- Click OK
Now open your googleVis html file and it should display successfully. In fact, any googleVis file you open from within the folder you selected will also display as you would expect.
这篇关于无法从打印的html文件中查看gvisMotionChart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!