title: Pass PHP result-set to JavaScript array in Highchart?
body: <p>I need to draw a bar chart by passing values from PHP to JavaScript</p>
  
  <pre><code>try { 
  $usr = 'MON_DW';
  $pswd = '4v$view'; 
  $dbConnStr = 'localhost';  
  $dbConn = null;
  $err = null;
  $dbConn = oci_connect($usr,$pswd,$dbConnStr);
  $err = oci_error();
  $strSQL = "SELECT /*+parallel(B,4)*/ PERCENT_USED FROM (SELECT A.TABLESPACE_NAME,
   ROUND(((A.BYTES-B.BYTES)/A.BYTES)*100,2) PERCENT_USED
  FROM
    (SELECT TABLESPACE_NAME,
      SUM(BYTES) BYTES
    FROM DBA_DATA_FILES
    GROUP BY TABLESPACE_NAME
    ) A,
    (SELECT TABLESPACE_NAME,
      SUM(BYTES) BYTES ,
      MAX(BYTES) LARGEST
    FROM DBA_FREE_SPACE
    GROUP BY TABLESPACE_NAME
    ) B
  WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME AND ROWNUM&lt; 5
  ORDER BY PERCENT_USED DESC)";
  $stmt = oci_parse($dbConn,$strSQL);
  if ( ! oci_execute($stmt) ){
  $err = oci_error($stmt);
  trigger_error('Query failed: ' . $err['message'], E_USER_ERROR);
  };
  
  $rslt = oci_fetch_array($stmt,OCI_BOTH)      ;
  ?&gt;
  &lt;script&gt;
  
  &gt;  var pausecontent = new Array();
  
      &lt;?php foreach($rslt as $key =&gt; $val){ ?&gt;
          pausecontent.push('&lt;?php echo $val; ?&gt;');    &lt;?php echo $val; } ?&gt;
  
  $(function () {
          $('#container').highcharts({
              chart: {
                  type: 'column',
                  margin: [ 50, 50, 100, 80]
              },
              title: {
                  text: 'World\'s largest cities per 2008'
              },
              xAxis: {
                  categories: [
                      'Tokyo',
                      'Jakarta',
                      'New York',
                      'Seoul',
                                                        ],
                  labels: {
                      rotation: -45,
                      align: 'right',
                      style: {
                          fontSize: '13px',
                          fontFamily: 'Verdana, sans-serif'
                      }
                  }
              },
              yAxis: {
                  min: 0,
                  title: {
                      text: 'Population (millions)'
                  }
              },
              legend: {
                  enabled: false
              },
              tooltip: {
                  pointFormat: 'Tablespaces in EDW : &lt;b&gt;{point.y:.1f} millions&lt;/b&gt;',
              },
              series: [{
                  name: 'Tablespaces',
                  data: pausecontent,
                  dataLabels: {
                      enabled: true,
                      rotation: -90,
                      color: '#FF00F',
                      align: 'right',
                      x: 4,
                      y: 10,
                      style: {
                          fontSize: '13px',
                          fontFamily: 'Verdana, sans-serif',
                          textShadow: '0 0 3px black'
                      }
                  }
              }]
          });
      });
  
  &lt;/script&gt;
  
  &lt;?php     
  }
  
  
   catch(Exception $exception){
     echo "Exception Details in Accessing find_largeobject details".$exception-&gt;getMessage();
          }
  </code></pre>