title: how to make data dynamic in javascript
body: <p>I am trying to make pie chart with data of variable "temp". The data are shown in the picture on console. How should I start this please help me with this. </p>
  
  <p><img src="https://i.stack.imgur.com/fPzCW.png" alt="enter image description here"></p>
  
  <pre><code>$(function () {
      var temp = &lt;?php echo $branch_emp; ?&gt;;
      console.log(temp);
      $('#pie_chart').highcharts({
          chart: {
              type: 'pie',
              options3d: {
                  enabled: true,
                  alpha: 45,
                  beta: 0
              }
          },
          title: {
              text: 'Incident Report'
          },
          tooltip: {
              pointFormat: '{series.name}: &lt;b&gt;{point.percentage:.1f}%&lt;/b&gt;'
          },
          plotOptions: {
              pie: {
                  allowPointSelect: true,
                  cursor: 'pointer',
                  depth: 35,
                  dataLabels: {
                      enabled: true,
                      format: '{point.name}'
                  }
              }
          },
          series: [{
              type: 'pie',
              name: 'Browser share',
              data: [ 
                  //this is where i want the data
                  // temp.foreach(function(){
                      ['a', 50.0],
                      ['b', 25.0],
                      ['c', 25.0],
                  // })
              ]
          }]
      });
  });
  </code></pre>