2013-08-15 3 views
7

무슨 일이 일어나는지 잘 모르겠습니다 만, 날짜가 축과 툴팁에 한 달에 표시됩니다. 따라서이 차트의 데이터에서 첫 번째 날짜는 7 월이지만 8 월과 같이 나타납니다. 어떤 아이디어? 또한 아래의 JSFiddle의 코드 (http://jsfiddle.net/Z2VGL/1/)을 넣어했습니다하이 차트 : 1 개월 단위로 날짜가 닫습니다.

$(function() { 
$('#container').highcharts({ 
    chart: { 
     type: 'spline' 
    }, 
    title: { 
     text: '' 
    }, 
    plotOptions: { 
     series: { 
      lineWidth: 5, 
      marker: { 
       fillColor: '#FFFFFF', 
       lineWidth: 2, 
       radius: 6, 
       lineColor: null // inherit from series 
      } 
     } 
    }, 
    subtitle: { 
     text: '' 
    }, 
    xAxis: { 
     type: 'datetime', 
     dateTimeLabelFormats: { // don't display the dummy year 
      month: '%e %b', 
      year: '%b' 
     } 
    }, 
    yAxis: { 
     title: { 
      text: 'Ability Score (out of 100)', 
      style: { 
       color: '#323A45', 
       fontWeight: 'bold' 
      } 
     }, 
     min: 0 
    }, 
    tooltip: { 
     formatter: function() { 
      return '<b>' + this.series.name + '</b><br/>' + Highcharts.dateFormat('%e %b', this.x) + ': ' + this.y; 
     } 
    }, 

    series: [{ 
     name: 'Overall Ability', 
     // Define the data points. All series have a dummy year 
     // of 1970/71 in order to be compared on the same x axis. Note 
     // that in JavaScript, months start at 0 for January, 1 for February etc. 
     data: [ 
      [Date.UTC(2013, 07, 12), 50], 
      [Date.UTC(2013, 08, 13), 57.9474605576], 
      [Date.UTC(2013, 08, 14), 58.5667571154], 
      [Date.UTC(2013, 08, 15), 69.0590308869], ] 

    }, { 
     name: 'Target', 
     data: [ 
      [Date.UTC(2013, 07, 12), 80], 
      [Date.UTC(2013, 08, 13), 80], 
      [Date.UTC(2013, 08, 14), 80], 
      [Date.UTC(2013, 08, 15), 80], 
      /* 
        [Date.UTC(2013, 0, 1), 80.0], 
        [Date.UTC(2013, 1, 1), 80.0], 
        [Date.UTC(2013, 2, 1), 80.0], 
        [Date.UTC(2013, 3, 1), 80.0], 
        [Date.UTC(2013, 4, 1), 80.0], 
        [Date.UTC(2013, 5, 1), 80.0], 
        [Date.UTC(2013, 6, 1), 80.0], 
        [Date.UTC(2013, 7, 1), 80.0] 
        */ 

, dashStyle 'longdash', 마커 : {활성화 : 거짓 } }]

}); 

});

미리 감사드립니다.

답변