I'm trying to use jquery.flot.js with jquery.flot.time.js plugin in order to setup a graph with years date on xaxis.
It's a simple graph, with two lines, each of them has a point for year 2014 and a second one for year 2015.
But I'm unabled to have correct time in xaxis legend: only 2015 is displayed, and not at the correct place:
I'm using simple data to generate the graph, with an interval of 1 year. My datetime is generated using javascript:
var date14 = new Date(2014, 1, 1, 1).getTime();
var date15 = new Date(2015, 1, 1, 1).getTime();
var data = {
{ label="Orders", data=[[date14, 51], [date15, 92]] },
{ label="Products", data=[[date14, 69], [date15, 121]] }
};
var options = {
series: {
lines: { show: true },
points: { show: true }
},
yaxis: {
minTickSize: 1
},
xaxis: {
mode: 'time',
timeformat: '%y',
tickSize: [1, 'year']
},
};
$.plot('#container1', data, options);
Any idea how to proceed to get a correct date xaxis legend with 2014 and 2015 on good position?