Google Visualization - Can you code U.S. Province level data AND some city plots on the same map?

喜欢而已 提交于 2019-12-13 04:39:23

问题


I'm building a Google Visualization DataTable. You can see it here:

http://jsfiddle.net/MmyKU/4/

I've built out my United States color coding, but I need to add plots of about 8 US Cities on top of the color coding. I can't find any documentation or other examples online that specifies if/how this is possible. I've taken a few stabs at it with no results.

I'm just trying to:

1) Verify if it's possible?

2) Find a working example or have some help adding a second table to a single drawVisualization instance!

Thanks!


回答1:


https://developers.google.com/chart/interactive/docs/gallery/geochart#Configuration_Options

add to your options

displayMode: 'markers',



回答2:


Regions and Markers wont work at the same time. SO if you want to color the background of the states, using markers mode, you can do it with CSS.

I'm documenting some examples for a Wordpress plugin i developed here: http://cmoreira.net/interactive-world-maps-demo/advanced-customization/

Check the last example. It's not easy, since you have to find which child path number you want to color, and then you can do it. Example:

#visualization path:nth-child(5) {
fill:#cccccc;
}

Here's a forked example, of your code with the CSS above: http://jsfiddle.net/cmoreira/Jqkjg/

Hope it helps!



来源:https://stackoverflow.com/questions/10644798/google-visualization-can-you-code-u-s-province-level-data-and-some-city-plots

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