2015-11-26 63 views
0

我想構建一個折線圖,但我的高圖不使用下面的代碼呈現。 有人可以檢查我做錯了什麼?Highchart錯誤與xaxis上的日期值

$('#employee_chart').highcharts({ 
     chart: { 
      type: 'line' 
     }, 
     title: { 
      text: 'REPORTS AT A GLANCE (LAST 30 DAYS)' 
     }, 
     xAxis: {    
      type: "datetime", 
      dateTimeLabelFormats: { 
       day: '%d' 
      }, 
      tickInterval: 24 * 3600 * 1000, 
      min: Date.UTC(<?php echo date("Y, m, d",strtotime("-30 days"));?>), 
      max: Date.UTC(<?php echo date("Y, m, d");?>) 
     }, 
     yAxis: { 
      title: { 
       text: 'Temperature (°C)' 
      } 
     }, 
     plotOptions: { 
      line: { 
       dataLabels: { 
        enabled: true 
       }, 
       enableMouseTracking: false 
      } 
     }, 
     series: [{ 
      name: 'Unique Logins', 
      data: [7, 6, 9, 14, 18, 21, 25, 26, 23, 18, 13, 9, 7, 6, 9, 14, 18, 21, 25, 26, 23, 18, 13, 9, 7, 6, 9, 14, 18, 21] 
     }] 
    }); 

謝謝

+0

什麼是錯誤/問題? –

回答

0

這個問題似乎從你的x軸的設置來: 正如你可以在這裏看到你的圖表呈現沒有這些設置:http://jsfiddle.net/e4fru078/

  tickInterval: 24 * 3600 * 1000, 
      min: Date.UTC(<?php echo date("Y, m, d",strtotime("-30 days"));?>), 
      max: Date.UTC(<?php echo date("Y, m, d");?>) 

我會建議看看categories for your xaxis: 示例:http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/chart/reflow-true/