javascript - flotr / protochart bar chart based on timestamps -
i want create bar chart flotr / protochart (tried both) can't work properly. when doing following, bars small grid line.
flotr.draw( $('workflow-chart'), [ { label: 'd1', data: [[1291622400000, 3], [1291708800000, 8], [1291795200000, 7], [1291881600000, 0], [1291968000000, 5]] } ], { bars: {show: true, fill: true}, xaxis: { tickformatter: function(t) { date = new date(); date.settime(t); day = date.getdate() > 9 ? date.getdate() : "0" + date.getdate(); month = date.getmonth()+1 > 9 ? date.getmonth()+1 : "0" + (date.getmonth()+1); return day + "." + month; } } } );
this question similiar flotr x-axis date/time hadn't helped.
you need set "mode" of xaxis here.
xaxis: { mode: "time", tickformatter: function(t) { date = new date(); date.settime(t); day = date.getdate() > 9 ? date.getdate() : "0" + date.getdate(); month = date.getmonth()+1 > 9 ? date.getmonth()+1 : "0" + (date.getmonth()+1); return day + "." + month; } }
Comments
Post a Comment