谷歌圖表 API 加載 (Google Chart API loading)


問題描述

谷歌圖表 API 加載 (Google Chart API loading)

As you may know the Google GeoMap (flash version) loads pretty slow. I've created a statistics menu having like 3 or 4 tabs, in each of them I have some statistics (line chart and pie chart load instantly). So I thought: I'll simply place the GeoMap Chart into a background tab so until the user gets there it will be loaded.

The question: Why doesn't the API load the GeoMap chart if the div in which is shown is hidden (display:none) ?


參考解法

方法 1:

  

Graphs will render incorrectly (often extremely small/close to   invisible) if rendered in a hidden element. You need to redraw the   graph after making the element visible.

https://stackoverflow.com/a/8600892/401554

(by XCSanroots)

參考文件

  1. Google Chart API loading (CC BY-SA 3.0/4.0)

#google-visualization #geomap #html






相關問題

帶有坐標的谷歌地理圖表? (Google geocharts with coordinates?)

通過 JavaScript 客戶端 API Auth 使用 Google 電子表格作為“已驗證”數據源的 Google 可視化 API (Google Visualization API using Google Spreadsheet as "Authenticated" Data Source via JavaScript Client API Auth)

在 PHP 中壓縮 JSON 字符串並在 Javascript 中解壓縮以進行 Google API 的數據庫查詢 (Compress JSON string in PHP and decompress in Javascript for Database query for Google API)

用於創建 innerHTML 的 JavaScript 循環(Google 表格) (JavaScript loop to create innerHTML (Google Sheet))

相當於 GViz setVisibleChartRange 的 Dygraphs? (Dygraphs equivalent for GViz setVisibleChartRange?)

避免 Google 圖表中 X 軸的小數點 (Avoid decimal points in X-axis in Google charts)

如何從 Google 的 Visualization API 生成的條形圖中刪除 x 軸? (How do you remove the x-axis from a bar chart produced by Google's Visualization API?)

谷歌圖表 API 加載 (Google Chart API loading)

為 Google Charts Api 編寫自定義格式化程序 (Write a custom formatter for Google Charts Api)

IE7中的谷歌圖表 (Google Chart's in IE7)

谷歌圖表 - 直方圖:刪除項目的水平劃分 (google charts - histograms: remove horizontal division of items)

與 jquery 一起使用時,Google 圖表上的 Vaxis 不顯示 (Vaxis on Google chart not showing when used with jquery)







留言討論