1 Reply Latest reply on Aug 1, 2014 2:14 PM by user3861177

    OBIEE / Javascript function calling Google API - Visualization does not appear until browser refreshed


      I have started playing around with the google visualization API's (https://developers.google.com/chart/interactive/docs/index).  I am using javascript within the narrative view of an analysis to call the google api.  My problem is that the visualization never appears on the first attempt.  If I refresh the browser or switch dashboard pages and then come back, then the visualization will appear.  Also, when the visualization does not appear, I cannot see my javascript at all when I view the page source in firefox, IE, or chrome.  When the visualization does appear, the javascript obviously shows up under page source.  As a short term counter measure, I have set up the dashboard page to automatically refresh once but that is far from ideal from a user experience perspective. Any ideas on how to make the visualization appear right away without refreshing the browser?


      In case it helps, here is an example of my javascript within the narrative view:


      <script type='text/javascript' src='https://www.google.com/jsapi'></script>

      <script type='text/javascript'>

      google.load('visualization', '1', {'packages': ['geochart']})    ;

        function drawRegionsMap() {

        var data = google.visualization.arrayToDataTable([

         ['Country', 'Number of Service Calls'],



      ['@1', @2]





      var options = {

                 colorAxis: {colors: ['orange', 'blue']}


      var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));

      chart.draw(data, options);



      <body onload = "javascript: drawRegionsMap();">

      <div id="chart_div" style="width: 1200px; height: 800px;"></div>