Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
Tableau Angular2 Integration

Has anyone tried building an Angular2 application with tableau visualizations integrated in it using the Tableau JavaScript API?

According to the documentation, you're supposed to include the following script in your file which will create a tableau global variable:

<script src="https://YOUR-SERVER/javascripts/api/tableau-2.js"></script>

I'm not sure how to access this global variable within an Angular2 class.

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Im using ng2-admin template and I was able to successfully integrate Tableau and Angular2.

Copy this script <script src="https://YOUR-SERVER/javascripts/api/tableau-2.js"></script> in index.html and paste it within its <body>. Then copy the embed code in any of the components html file within a div.

about 4 years ago · Santiago Trujillo Report

0

declare var tableau: any;

viz: any;//Inside your component class


initViz() {
    const containerDiv = document.getElementById("vizContainer");
    const vizUrl="https://public.tableau.com/views/WorldIndicators/GDPpercapita";
 
    const options = {
      width: containerDiv.offsetWidth,
      height: 600,
      // hideTabs: true,
      // hideToolbar: true,
      onFirstInteractive: function (ev) {
        console.log(ev);
      }
    };
    if(viz != null) { // viz is undefined on both the first and second page loads - even though second page load throws a 'viz already present' error
     viz.dispose();
    }
    var viz = new tableau.Viz(containerDiv, vizUrl,options);
  }
  
  ngOnInit() {    
    this.initViz();
  }

By declaring global variable you can acces it inside component.

about 4 years ago · Santiago Trujillo Report

0

For anyone who wants to embed Tableau visualizations in Angular apps, ngx-tableau provides a simple interface to the Tableau JavaScript API.

It has multiple options for configuring the connection to Tableau Server, handling authentication tickets, adding filters to reports, and managing different sites.

Disclaimer: I am the main contributor to the library.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!