2013-08-15 17 views
7

Non sono sicuro di cosa sta succedendo, ma le date vengono visualizzate sull'asse e in suggerimenti un mese. Quindi la prima data nei dati di questo grafico è a luglio ma si presenta come in agosto e così via. Qualche idea? Ho messo il codice in un JSFiddle (http://jsfiddle.net/Z2VGL/1/) e anche al di sotto:Highcharts: Date disattivate per 1 mese

$(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', marcatore: { enabled: true} }]

}); 

});

Grazie in anticipo.

risposta