Tableau Full Screen View With JavaScript API - Stack Overflow

Is it possible to force tableau server or online to display the view in full screen when loading an emb

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
Add a ment  | 

2 Answers 2

Reset to default 3

There 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

相关推荐

  • Tableau Full Screen View With JavaScript API - Stack Overflow

    Is it possible to force tableau server or online to display the view in full screen when loading an emb

    3小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信