title: high chart date format in x-axis
body: <p>I am using column chart in highchart in this i want to show x-axis in date format which i fetch from the google analytics data of my account.and i want to view the date on x-axis and which is not coming in format i want it in formatted way.
  it comes like this way "20151001" and i want it to be like this "01-10-2015"
  my data is come from google analytic account so i cant use highchart data
  this is my code for this</p>
  
  <p>php code from which i get date</p>
  
  <pre><code>     $matrics='ga:sessions,ga:pageviews';
       $results_top_pages = $analytics-&gt;data_ga-&gt;get(
      'ga:109200082',
       date('Y-m-d',strtotime('-6 days')),
       date('Y-m-d',strtotime('now')),
       $matrics,
        array(
  
          'dimensions' =&gt; 'ga:date',
         // 'sort' =&gt; '-ga:pageviews', for acsending and decending page view sorting
      'filters'=&gt;'ga:browser%3D~%5E'.$browser.'',
          'max-results' =&gt; 50
       ));
  
    if(is_array($results_top_pages-&gt;getRows())){
        echo '&lt;ol&gt;';
        foreach($results_top_pages-&gt;getRows() as $top_page){
          echo '&lt;li&gt;';
          echo $top_page[0];
          echo ' - '.$top_page[1].' ';
          echo ' - '.$top_page[2].' ';
          $data[]=$top_page[2];
          $date[]=$top_page[0];
          echo '&lt;/li&gt;';
          }
           echo '&lt;/ol&gt;';
       }
  </code></pre>
  
  <p>by var_dump of $date i get date in this format:</p>
  
  <pre><code>    array(7) {
     [0]=&gt;
     string(8) "20150930"
     [1]=&gt;
     string(8) "20151001"
     [2]=&gt;
     string(8) "20151002"
     [3]=&gt;
     string(8) "20151003"
     [4]=&gt;
     string(8) "20151004"
     [5]=&gt;
      string(8) "20151005"
     [6]=&gt;
     string(8) "20151006"
     }
  </code></pre>
  
  <p><h2>Edited code from here</h2> ::</p>
  
  <pre><code>    This is js code for highchart:
  
         $data[]=$top_page[2];
        $date[]=date('d-m-y',strtotime($top_page[0]));
  
         // echo '&lt;/li&gt;';
           }
            echo '&lt;/ol&gt;';
        }
        var_dump($date[0]);
         $datefirst= date('U', strtotime($date[0])) * 1000;
  
       ?&gt;
  
      &lt;script&gt;
  
       $(function () {
  
          $('#container').highcharts({
           //alert("call");
  
       chart: {
           type: 'column'
       },
       title: {
          text: 'Weekly Traffic'
       },
       subtitle: {
           //text: 'Source: WorldClimate.com'
        },
        xAxis: {
  
          categories: [&lt;?php echo join($date,','); ?&gt;],
          max:6
         },
        yAxis: {
              title: {
              text: 'Views'
          }
        }, 
         plotOptions: {
          line: {
              dataLabels: {
                  enabled: true,
              connectNulls: false
               },
               enableMouseTracking: false
             }
         },
         series: [{
         pointStart: '&lt;?php echo $datefirst; ?&gt;',
          pointInterval: 86400000, //one day
          pointRange: 86400000, //one day
          name: '&lt;?php echo $browser; ?&gt;',
          data: [&lt;?php echo join($data, ',') ?&gt;],
          //pointStart: Date.UTC(2015, 0, 1),
          //  pointInterval: 24 * 3600 * 1000
         },
  
         ]
          });
          });
         &lt;/script&gt;
        &lt;div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"&gt;&lt;/div&gt;
  </code></pre>