![](/img/trans.png)
[英]How do I use the Tableau Javascript API to embed dashboards in a webpage for dashboards hosted in Tableau Online?
[英]How to embed Tableau into a web page using the tableau JavaScript API?
我是一個初學者,試圖將Tableau可視化效果嵌入到我的網頁中,以便每當單擊鏈接時,可視化效果就會呈現在頁面上。 但是瀏覽器在tableauSoftware對象上加載了錯誤。 如何初始化該對象?
我正在使用Tableau Server試用版
<html>
<head>
<script type='text/javascript' src='http://localhost:85/javascripts/api/viz_v1.js'></script>
<script>
function initializeViz() {
var placeholderDiv = document.getElementById("tableauViz");
var url2 = "http://localhost:85/views/test_page/Sheet1?:embed=y&:display_count=no";
viz = new tableauSoftware.Viz(placeholderDiv, url2);
}
</script>
</head>
<body>
<a href="#" onclick="$('#tableauViz').html(''); initializeViz()">visualize</a>
<div class id ="tableauViz"></div>
</body>
</html>
我收到此錯誤:
我沒有手提電腦來確認應該在本地Tableau Server安裝上使用哪個腳本,但是嘗試Tableau Public腳本(根據JavaScript API Tutorial ),看看是否有任何更改:
<script type="text/javascript" src="http://public.tableausoftware.com/javascripts/api/tableau_v8.js"></script>
現在已經檢查了我自己的本地Tableau Server安裝,您需要的腳本是以下腳本:
<script type="text/javascript" src="http://localhost:85/javascripts/api/tableau_v8.js"></script>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.