Is it possible to force tableau server or online to display the view in full screen when loading an embedded view? You can do this with one more step by clicking the Full Screen option in the menu items (img below). It would be great to have this as the default or be able to toggle with the API. Is that possible? Thanks!
Is it possible to force tableau server or online to display the view in full screen when loading an embedded view? You can do this with one more step by clicking the Full Screen option in the menu items (img below). It would be great to have this as the default or be able to toggle with the API. Is that possible? Thanks!
Share Improve this question asked Apr 7, 2017 at 19:24 vizyourdatavizyourdata 1,4441 gold badge19 silver badges46 bronze badges 2- Yes, that should be possible. – Hackerman Commented Apr 7, 2017 at 19:40
- would you care to elaborate? – vizyourdata Commented Apr 7, 2017 at 19:53
2 Answers
Reset to default 3There is an even easier way. The "Fullscreen" view is simply an iframe. If you look at the source of the iframe and navigate directly to that address then you get the fullscreen view.
I dont think there is an api function to resize the view to full screen. however, you can use the below code to resize the tableau frame using javascript api.
function setFrameSize() {
if (mainViz === null) {
alertOrConsole("No Viz has been rendered");
return;
} else {
mainViz.setFrameSize(900, 480);
}
}
Also please let me know which version of tableau you are using.
Edit
You can use the fullscreen API as below
Create a javascript function for various browsers
var element = document.getElementById("divid");
// Find the right method, call on correct element
function launchIntoFullscreen(element) {
if(element.requestFullscreen) {
element.requestFullscreen();
} else if(element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if(element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
} else if(element.msRequestFullscreen) {
element.msRequestFullscreen();
}
}
// Launch fullscreen for browsers that support it!
launchIntoFullscreen(document.documentElement); // the whole page
launchIntoFullscreen(document.getElementById("videoElement")); // any individual element
For exiting the fullscreen mode,
function exitFullscreen() {
if(document.exitFullscreen) {
document.exitFullscreen();
} else if(document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if(document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
}
// Cancel fullscreen for browsers that support it!
exitFullscreen();
Hope this might help you.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745296882a4621196.html
评论列表(0条)