2011-11-10 9 views

Respuesta

26

En realidad pretty easy para producir usando flot.

var options = { 
    series: { 
     bars: { 
      show: true, 
      barWidth: 15778463000, // 1/2 year in milliseconds 
      align: 'center' 
     }, 
    }, 
    yaxes: { 
     min: 0 
    }, 
    xaxis: { 
     mode: 'time', 
     timeformat: "%y", 
     tickSize: [1, "year"], 
     autoscaleMargin: .10 // allow space left and right 
    } 
}; 

$(function() { 
    $.plot($('#placeholder'), [[[1230768000*1000, 100], //[seconds * 1000 = milli, y value] 
           [1262304000*1000, 200], 
           [1293840000*1000, 300]]], options); 
}); 

Produce:

enter image description here

+0

La propiedad 'barWidth' hizo el truco para mí! –

Cuestiones relacionadas