8

我是一名初学者,试图将 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>

我收到此错误:

在此处输入图像描述

4

1 回答 1

5

我手头没有笔记本电脑来确认应该在本地 Tableau Server 安装上使用哪个脚本,但请尝试使用 Tableau Public 脚本(根据JavaScript API 教程),看看是否有任何变化:

<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>
于 2014-01-12T10:49:56.440 回答