簡體   English   中英

如何在wordpress中嵌入谷歌電子表格圖表?

[英]How to embed a google-spreadsheet chart in a wordpress?

我想在 wordpress 帖子中嵌入圖表。 我正在使用通過使用谷歌表中的發布功能生成的腳本。

如果我將生成的腳本添加到通用 html 頁面,我可以看到圖表。

如果我將生成的腳本添加到 wordpress 帖子中,則會出現以下錯誤:“給定軸上的所有系列必須具有相同的數據類型×”

我是否需要修改 wordpress 頁面中的腳本或其他內容以正確可視化圖表?

謝謝

這是 Google-sheets 生成的代碼:

<script type="text/javascript" src="//ajax.googleapis.com/ajax/static/modules/gviz/1.0/chart.js"> {"dataSourceUrl":"//docs.google.com/spreadsheet/tq?key=0AgtmZPWzQ7lldEt2S2VLajBRQVNFLV9pRFY2bTRQLVE&transpose=0&headers=1&range=A2%3AB1010&gid=0&pub=1","options":{"titleTextStyle":{"bold":true,"color":"#000","fontSize":16},"curveType":"","animation":{"duration":500},"width":1270,"lineWidth":2,"hAxis":{"useFormatFromData":true,"title":"Data","minValue":null,"viewWindowMode":null,"viewWindow":null,"maxValue":null},"vAxes":[{"useFormatFromData":true,"title":"\u00b5g/m\u00b3","minValue":null,"logScale":false,"viewWindow":{"max":null,"min":null},"maxValue":null},{"useFormatFromData":true,"minValue":null,"logScale":false,"viewWindow":{"max":null,"min":null},"maxValue":null}],"booleanRole":"certainty","title":"Via Ariosto, SO2","height":469,"interpolateNulls":false,"legend":"right","focusTarget":"series","useFirstColumnAsDomain":false,"tooltip":{"trigger":"none"}},"state":{},"view":{},"isDefaultVisualization":false,"chartType":"LineChart","chartName":"Chart 1"} </script>

另一種選擇是使用專門為與 Google Charts API 集成而設計的 WordPress 插件。 適用於 WordPress內聯 Google 電子表格查看器插件使用 Google 電子表格作為數據源,讓您可以輕松地在許多 Google 圖表和圖形可視化中的任何一個中顯示該數據。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM