title: Dynamically add xaxis to an highcharts
body: <p>I have a problem with my highcharts to add dynamically a x-axis to an chart generated by HighCharts.</p>
  
  <p>Why I want to add x-axis dynamically ? Because my graph can have an unlimited numbers of series but I don't regenerate it completly each time I add a serie.</p>
  
  <p>Since HighCharts 3.0, "we" can add dynamically a x-axis to a chart without recreate it.
  Here is a reduced test, but that doesn't works.
  It only add yAxis, I can't found a way to add xAxis by the same function ( <a href="http://api.highcharts.com/highcharts#Chart.addAxis()" rel="nofollow">http://api.highcharts.com/highcharts#Chart.addAxis()</a> )</p>
  
  <pre><code>$(function() {
      var chart = new Highcharts.Chart({
          chart: {
              renderTo: 'container9'
          },
          xAxis: [{
              categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
          },{},{}],
          series: [{
              data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
          }]
      });
      console.log("Initial number of xAxis : " +chart.xAxis.length);
      console.log("Initial number of yAxis : " +chart.yAxis.length);
      $('#addaxis').click(function () {
          // The function I use is : http://api.highcharts.com/highcharts#Chart.addAxis()
          // It should works, but I can't found how
          chart.addAxis({
              categories: ['Mon', 'Tue', 'Thi', 'Fri']
          },false);//Try the false paramater which is a boolean where true means xAxis and false means yAxis
          //Neither of these two posibilities work.
          chart.addAxis({
              categories: ['I', 'You', 'He', 'She', 'We', 'You', 'They']
          },true);//Try the true paramater
          console.log("Number of xAxis : " + chart.xAxis.length); // nothing more
          console.log("Number of yAxis : " + chart.yAxis.length); // 2 more yAxis, but I want just one add of xAxis
          //Add a x-axis dynamically, it's what I am looking for. Thank in advance. 
      });
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/pz4Jx/3/" rel="nofollow">http://jsfiddle.net/pz4Jx/3/</a></p>
  
  <p>Hope you can help me.</p>