Build Custom Visualizations for Apps/Scripts | Teradata AppCenter - Building Custom Visualizations for Apps and Scripts - Teradata AppCenter

Teradata® AppCenter User Guide

Product
Teradata AppCenter
Release Number
1.9
Published
December 2019
Language
English (United States)
Last Update
2019-12-17
dita:mapPath
pkv1559060912029.ditamap
dita:ditavalPath
boe1555608925945.ditaval
dita:id
B035-1111
lifecycle
previous
Product Category
Analytical Ecosystem

"" User, Administrator

AppCenter supports upload of custom visualization code for apps that run once or on schedule and SQL scripts. To create JavaScript code with visualizations that you can upload as a bundle file to your SQL app or script, do the following:

  1. In an app or SQL script, run any SELECT statement.
    You get JSON data in the following format:
    {  
       "queueDuration":1,
       "queryDuration":175,
       "results":[  
          {  
             "resultSet":true,
             "data":[  
                {  
                   "name":"username1",
                   "address":"santa clara"
                },
                {  
                   "name":"username2",
                   "address":"san jose"
                }
             ],
             "rowCount":12,
             "rowLimitExceeded":false
          }
       ]
    }
    
  2. In the visualization code, add $$$$$$ where you want the data you extracted to be inserted at runtime.
    For example:
    <html>
    	<head>
    		<meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
    		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    	</head>
    	<body>
    		<script type='text/javascript'>
    	  $(document).ready(function() {
    		 var data = $$$$$$;
    		 $('div p').text(JSON.stringify(data)); //converting the data to string for display
    		 });
    	</script>
    		 <div style="width: 100%; height: 100%; width: 100%;">
    			  <p></p>
    		 </div>
    	</body>
    </html>
  3. In Settings for your SQL app or script, select Custom (Upload) to upload the JavaScript bundle file.