4 Replies Latest reply on Dec 9, 2015 3:00 AM by Yongyuth Songsiridej

    Controlling Text Formatting with Javascript API

    Yongyuth Songsiridej

      Is it possible to control the font-size, color and other styles of the components inside a Tableau Dashboard with the Javascript API?

      For example, category titles, label texts or any other texts.

       

      If it's not possible, do we have any way we can assign the titles a CSS class or HTML tags so that we can control them with CSS or javascript?

       

      Thanks in Advance!

        • 1. Re: Controlling Text Formatting with Javascript API
          Derrick Austin

          Hey Yongyuth,

           

          This is not currently possible with the JS API. The API also basically creates an iframe view of the dashboard instead of creating it inline, so you would have trouble formatting inside the iframe with CSS as well.

          1 of 1 people found this helpful
          • 2. Re: Controlling Text Formatting with Javascript API
            Yongyuth Songsiridej

            Hi Derrick,

             

            Thank you for your response. I had anticipated that it might not be possible.

             

            Anyway, is there any other way we  can control text formatting of Tableau for responsive purposes?

            • 3. Re: Controlling Text Formatting with Javascript API
              Derrick Austin

              If you have the dashboard set to "automatic" or "range", it will rearrange the font to fit inside the newly sized boxes, but it does not seem to make it larger.

               

              At TC15, they announced some mobile/tablet changes that would switch out dashboard formatting based on the viewport.

               

              You could do something similar by having two different dashboards and switching them out dynamically, based on the user's screensize.

              • 4. Re: Controlling Text Formatting with Javascript API
                Yongyuth Songsiridej

                Hi Derreck,

                 

                Thank you for your response. Actually, I'm working with the ranges option right now. But this has some limitations. After around 700px and below, the tables stop shrinking and the part which do not fit the screen size are hidden without a scrollbar.

                 

                The feature you mentioned, finding the viewport and switching the dashboards, actually we have been doing that for some time now. But we don't use Tableau Script or feature for that, we have written our own custom code to do that.

                 

                We are actually trying to make that single dashboard work across all device sizes and have gained some success but the Internal data of Tableau just isn't as flexible. Some of them get squeezed and data are hidden under another data disturbing the information.

                 

                They recently rolled out 9.2 but still there aren't much promising features for mobile viewing yet. I saw the tableau IOS app for mobile and I thought to myself, why would they develop an IOS app to use the Tableau instead of making it better viewable from mobile devices first? I'm not sure how the app actually works yet.