2013-10-14 177 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 

尝试将格式更改为毫秒