Google visualization not working with local file

余生长醉 提交于 2019-12-23 02:52:17

问题


I'm working with a treemap, but the scale is coming out black. (related question: Google TreeMap fill value set to _ABSTRACT_RENDERER_ID_1). After reading that I was able to track down the problem to the code that google generates. It looks like the definitions are being declared correctly, but then the url to them looks like maybe doesn't work with local files. Perhaps because I'm working with a local file, see below: url(file:///D:/... )

<defs>
<linearGradient gradientUnits="userSpaceOnUse" ...  id="_ABSTRACT_RENDERER_ID_2">
...
<linearGradient gradientUnits="userSpaceOnUse" ... id="_ABSTRACT_RENDERER_ID_3">
...
</defs>

...

<rect fill="url(file:///D:/.../Original.html#_ABSTRACT_RENDERER_ID_2)" ... ></rect>
<rect fill="url(file:///D:/.../Original.html#_ABSTRACT_RENDERER_ID_3)" ... ></rect></g>

I've simplified the code by replacing irrelevant bits with .... I hope that doesn't confuse anyone.

Is this a problem due to not running from a server? (edit: I set up IIS on my machine. It's confirmed, the scale renders correctly)

From what I have seen from online examples is that there is no need to specify the file.

<rect fill="url(#_ABSTRACT_RENDERER_ID_2)" ... ></rect>
<rect fill="url(#_ABSTRACT_RENDERER_ID_3)" ... ></rect></g>

Is it possible to get this working from my local file system?


回答1:


Parentheses and single quotes are not permitted in the path. I.e, ( ) and '.

The other acceptable path characters do not cause a problem for rendering the treemap scale: {}`` &-,.[]^%$#@!; (Those are back quotes in there)



来源:https://stackoverflow.com/questions/35283410/google-visualization-not-working-with-local-file

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