5 Replies Latest reply on Aug 13, 2013 12:32 PM by Daniel VanderMeer

    How does one specify a size range when using the embed code

    Steve Wexler

      Folks,

       

      While I have set my dashboards to have a min and max range, the share embed code feature creates a fixed dashboard size.  What is the syntax to specify a range in the embed code?

       

      Steve

        • 1. Re: How does one specify a size range when using the embed code
          Daniel VanderMeer

          Steve,

           

          Once you embed the snipped into your web page you can alter the height and width to something that makes sense for your web page.

           

          The example below changes the fixed pixel height and width to be percent based. Now the VIZ will resize based on the available browser width and height along with the min and max range you've specified in Tableau.

           

          <HTML>

          <body>

           

          <script type="text/javascript" src="http://yourServer/javascripts/api/viz_v1.js"></script>

          <div class="tableauPlaceholder" style="width:100%; height:100%;">

          <object class="tableauViz" width="100%" height="100%" style="display:none;">

          <param name="host_url" value="yourURL" />

          <param name="site_root" value="" />

          <param name="name" value="yourBook" />

          <param name="tabs" value="no" />

          <param name="toolbar" value="yes" /></object>

          </div>

           

          </body>

          </HTML>

           

           

          Hope this helps!

          Daniel.

          1 of 1 people found this helpful
          • 2. Re: How does one specify a size range when using the embed code
            Steve Wexler

            Daniel,

             

            I did discover the percent parameter, but I don't see how to specify a pixel max / min range.  Indeed, specifying 100% reminds me of Tableau's auto resizing capability and that can produce some unwanted results when you try to fashion something that works on both small and very large screens.

             

            If I could get away with it I would just specify a fixed width as I *know* it will look just right, but the client wants some accommodation for users with larger viewing screens.

             

            So ... is there a way to specify a fixed range?

             

            Steve

            • 3. Re: How does one specify a size range when using the embed code
              Daniel VanderMeer

              Steve,

               

              I don't think you need to control min and max inside both the browser and Tableau.

               

              There are two things at work here:

              1. The available browser space

              2. The size constraints set up by specifying min and max inside of Tableau

               

              When you set the browser container to 100% it will make the container size equal to the available space in the browser, but tableau server will not let the Viz be bigger than the max, or smaller than the min.

               

              so if the available browser space is larger than the max you have your VIZ remains constrained (your desired result.)

               

              When the available browser space is within the bounds of the min and max your VIZ will be as large as the available browser space (your desired result.)

               

              When the available browser space is smaller than the min then Tableau server will constrain the Viz to not get smaller than the min and the browser will shows vertical or horizontal scrollbars as needed (also your desired result.)

               

              Daniel.

              • 4. Re: How does one specify a size range when using the embed code
                Steve Wexler

                Daniel,

                 

                Oooh, this is getting interesting!

                 

                So, the first 100% indicates that Tableau should setup a "space" that is as large as the browser will allow, but the second 100% indicates " take into account my min max settings when figuring out how large the dashboard should be within the space"

                 

                I will experiment but what your describe is indeed the behavior that I want -- I just didn't realize that Tableau would respect the max / min settings.

                 

                Steve

                • 5. Re: How does one specify a size range when using the embed code
                  Daniel VanderMeer

                  The 100% on the div and the 100% on the Viz work towards the same goal of making the viz as big as the available space with Tableau Server applying the min max constraints...

                  1 of 1 people found this helpful