title: How to use a javascript variable in highcharts series?
body: <p>I want to use a javascript variable in a highchart series , but it doesn't seem to work :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function groupBar(n) {
   var nu;
   nu = parseInt(n); 
  
   var series_b_tab =  &lt;?php echo json_encode($series_bar)?&gt;; 
   
   var series_b = series_b_tab[n];
   series_b = series_b.join(",");
    
      $('#bar_project_'+n).highcharts({
        
          chart: {
              type: 'column',
              height : 300,
              width: 500
          },
          title: {
              text: 'Logements connectés'
          },
          subtitle: {
              text: 'Source: Valenciennes Métropole'
          },
          xAxis: {
              categories: [&lt;?php echo join($legend_bar,',') ?&gt;],
              title: {
                  text: null
              },
              labels: {
                rotation: -45,
               style: {
                      fontSize: '9px'
                  }
              }
          },
          yAxis: [
          {
              min: 0,
              //max: 8000,
              labels:{
                  style :{
                      color: 'red'
                  }
              },
              title: {
                  
                  text: 'Nombre de connexions par type',
                  align: 'middle'
              },
              labels: {
                  overflow: 'justify'
              },
              opposite: true
          },
          // second yAxis
          {
              min: 0,
              //max: 70,
              labels:{
                  style :{
                      color: 'red'
                  }
              },
              title: {
               text: 'Pourcentage (%)',
                  align: 'middle'
              },
              labels: {
                  overflow: 'justify'
              }
          }],
          tooltip: {
              valueSuffix: ' %'
          },
          legend: {
              layout: 'vertical',
              align: 'left',
              verticalAlign: 'top',
              x: 50,
              y: 60,
              floating: true,
              borderWidth: 1,
              backgroundColor: '#FFFFFF',
              shadow: true,
              itemStyle: {
                  color: 'black', 
                  fontSize: '9px'
              }
          },
          
          plotOptions: {
              series: {
                  animation: false
              },
          },
    
          series: [{series_b}]
   
  
      });
  };</code></pre>
  </div>
  </div>
  </p>
  
  <p>an exemple of series_b_tab[n] when n=1 is like this :</p>
  
  <p>{name : ' Commité : 0', type :'column', yAxis : 1  ,data : [2436]},{name : ' Commité : 1', type :'column', yAxis : 1  ,data : [2510,171]}</p>
  
  <p>I don't know how to put the content of series_b in series.</p>
  
  <p>Maybe I could use json_parse ?</p>
  
  <p>thanks for your help !</p>