2013-10-14 83 views
0

this fiddle中描述的圖表中,x軸上的日期標籤丟失。誰能告訴我爲什麼?下面列出了小提琴中的代碼:Highcharts中缺少日期標籤

$(function() { 
     var counts = [[635172879695710000, 383], [635172882696280000, 271], [635172885696780000, 274]], 
     averages = [[635172879695710000, 288774], [635172882696280000, 85592], [635172885696780000, 79455]], 
     ranges = [[635172879695710000, 12, 2760740], [635172882696280000, 12, 2761263], [635172885696780000, 12, 2761265]]; 

     $('#container').highcharts({ 
      title: { 
       text: 'Testing!' 
      }, 
      xAxis: { 
       type: 'datetime' 
      }, 
      yAxis: [{ 
        labels: { 
         format: '{value}B', 
         style: { 
          color: '#89A54E' 
         } 
        }, 
        title: { 
         text: 'Size', 
         style: { 
          color: '#89A54E' 
         } 
        }, 
        min: 0 
       }, { 
        labels: { 
         format: '{value}M', 
         style: { 
          color: '#4572A7' 
         } 
        }, 
        title: { 
         text: 'Messages', 
         style: { 
          color: '#4572A7' 
         } 
        }, 
        min: 0, 
        opposite: false 
       }], 
      tooltip: { 
       shared: true 
      }, 
      series: [{ 
        name: 'Line', 
        type: 'spline', 
        data: averages, 
        color: '#89A54E', 
        zIndex: 1, 
        marker: { 
         enabled: false 
        } 
       }, { 
        name: 'Area', 
        data: ranges, 
        type: 'areasplinerange', 
        lineWidth: 0, 
        linkedTo: ':previous', 
        color: '#89A54E', 
        fillOpacity: 0.3, 
        zIndex: 0 
       }, { 
        name: 'Count', 
        data: counts, 
        type: 'spline', 
        zIndex: 2, 
        color: '#4572A7', 
        yAxis: 1, 
        marker: { 
         enabled: false 
        } 
       }] 
     }); 
    }); 

回答

1

高圖表是無法解析,你已經給了datetime

以下error

檢查控制檯無法調用未定義

法 'SUBSTR' 你dateTime似乎micromilliseconds,這是無效的

635172879695710000 
635172882696280000 
635172885696780000 

嘗試將格式更改爲毫秒