forked from sandiegohearts/sandiegohearts.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
32 lines (28 loc) · 1.37 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<html>
<head>
<script type="text/javascript" src="https://public.tableau.com/javascripts/api/tableau_v8.debug.js"></script>
</head>
<body>
<script>
var vizDiv=document.getElementById('viz');
var vizURL= "https://public.tableau.com/views/SanDiegoMapping/CHDRateinSDCounty?:embed=y&:display_count=yes";
var options= {
width: '100%',
height: '768px',
hideToolbar: true,
hideTabs: false,
onFirstInteractive: function(){
document.getElementById('sheetName') .innerHTML=viz.getWorkbook().getActiveSheet().getName();
}
};
viz= new tableauSoftware.Viz(vizDiv, vizURL, options);
viz.addEventListener('tabswitch',function(event){
document.getElementById('sheetName') .innerHTML=event.getNewSheetName();
});
function switchView(sheetName){
workbook=viz.getWorkbook();
workbook.activateSheetAsync(sheetName);
}
</script>
</body>
</html>