Complete the code to embed a Tableau dashboard using the JavaScript API.
var viz = new tableau.Viz(document.getElementById('vizContainer'), '[1]');
The URL must point to the Tableau dashboard to embed, so the server dashboard URL is correct.
Complete the code to set the width of the embedded Tableau viz to 800 pixels.
var options = { width: [1] };The width option expects a number, not a string with 'px'.
Fix the error in the code to correctly apply a filter to the embedded Tableau viz.
viz.getWorkbook().[1]('Region', ['West'], tableau.FilterUpdateType.REPLACE);
The correct method to apply a filter asynchronously is applyFilterAsync.
Fill both blanks to initialize the Tableau viz with options to hide tabs and set height to 600.
var options = { [1]: true, [2]: 600 };Use hideTabs set to true to hide tabs, and height to set the viz height.
Fill both blanks to listen for the 'FIRSTINTERACTIVE' event and log a message.
viz.addEventListener(tableau.TableauEventName.[1], function() { console.[2]('Dashboard is ready'); });
The event name is FIRSTINTERACTIVE and the console method to print is log.