5 Replies Latest reply on Oct 3, 2013 7:51 AM by John Jose

    How to make VIZ read only javascript APIs.

    James Charley

      Recently we have purchase a tableau license to integrate it with our web application.


      Now we have following issues.


      1) We cannot disable ZOOM control and even in the web application it seems by double clicking the bar it will start growing. Which looks really ugly and no one can understand what is going on.


      2) We have kept some annotation in the bar and it seems entire annotation is getting highlighted in red color box in our web page. (One we enable zoom control).


      What we are hoping is for some control which can make the sheet read only (We have filters as well so it is not static) but end user should not be able to change/select anything (annotation, zoom etc inside the bar)


      We use following code to get the workbook from tableau server. we were hoping for some more VIZ(Disable zoom,annotation highlighting etc) option but it seems it is not available.


      var placeholderDivSecond = document.getElementById("renderSecond");

      var urlSecond = url;

      var optionsSecond = {



        hideTabs: true,



        • 1. Re: How to make VIZ read only javascript APIs.
          James Charley



          Any one is having any idea ? Just wanted to get some basic idea to make sure we are not missing basic thing.

          • 2. Re: How to make VIZ read only javascript APIs.
            Russell Christopher

            Hi James -


            On #1: There is no way to disable zoom via the JavaScript API or via any other mechanism. This sounds like a user training issue more than anything else. You might want to add some text to the dashboard to explain to users what to do and what not to do in this regard.


            I don't quite understand what you're doing in #2 - perhaps you can paste a screen shot of what you want / don't want? In any case, there is no API method that allows you to highlight an annotation. One thing that might work for you is to:


            • Use a parameter driven expression which either shows or hides label text for marks (bars, circles, lines, whatever) based on the value of the parameter
            • Use the JS API to change the parameter value to show / hide labels as an approximation of an annotation
            • Use the JS API to SELECT particular marks (bars, circles, etc.) to make them "jump out" at the user - sort of an approximation of highlighting.


            Hope this helps.

            • 3. Re: How to make VIZ read only javascript APIs.
              James Charley

              Hi Russell Thanks for your response.



              I guess first is not a training issue. For me it does not make sense to give zoom option for 350 * 350 dashboard.


              Given below is the screen shot original and after zoom of dashboard. You can make out how ugly it is looking.


              Also when you enter in to the world of web there can be more than 100k users. We cannot train all 100k users. And even in some cases we donot know who is going to use it.


              Oringinal : -





              Post Zoom : - (Some times it goes here and there for PIE and GROUPED bar chart and bar it itself is not visible).



              2) Annotation issue.


                  Zoom the Dashboard once.

                  Click the annotation inside a sheet.


                  Ugly Red color box will be visible around annotation inside dashboard. This is ok for tableau desktop but not when you display this dashboard inside web application.


                  Annotation box.png


              By looking at above issues I feel tableau is not yet production ready for web world. What do you think ?


              For web application it should be more of a read only kind of dashboard.

              • 4. Re: How to make VIZ read only javascript APIs.
                Russell Christopher

                Hey James --


                Regardless of how someone tries to "user proof" software, they always surprise you. In your case that translates into some users zooming on an inadvertent double-click.


                Most of them will figure out what they did wrong on their own, and will self-correct. Is that optimal? Nope, probably not. Is it worth spending time to change the behavior when it could be spent elsewhere on the product? Maybe, maybe not.


                You can add help in a tooltip or text to warn them if zoom is causing you that much grief, as well.


                FYI, there ARE other folks who'd like to see a change in this behavior ( http://community.tableau.com/ideas/1043). You'll probably want to vote for this.

                • 5. Re: How to make VIZ read only javascript APIs.
                  John Jose



                  Did you find any work around(making read only) for this issue ? We are trying to disable color highlighting inside the sheet but can't do it.


                  What we have done is put transparent div on top of this VIZ(IFRAME) (But post this you will not be able to do any activity inside this VIZ IFRAME. If you have filters inside your VIZ you cannot expand it. That is where we are stuck.)