javascript - jqPlot - Insert Date (yyyy-mm-dd) to (dd/mm/yyyy) -
the input in example (jqplot) code yyyy-mm-dd.
var line1=[['2008-08-12',4], ['2008-08-13',6.5], ['2008-08-14',5.7], ['2008-08-15',9], ['2008-08-16',8.2], ['2008-08-17',7.2], ['2008-08-18',3.2]];
but work here format dd/mm/yyyy hh:mm. should better transform input yyyy/mm/dd or easy change?
thanks time.
input date formatted :
var line2=[['30/09/2008 4:00pm',4],['30/10/2008 4:00pm',6.5], ['30/11/2008 4:00pm',5.7], ['30/12/2008 4:00pm',9], ['30/01/2009 4:00pm',8.2]];
are understandable jqplot. can therefore use dd/mm/yyyy hh:mm
format.
see working example here add new variable : var line2
display date in dd/mm/yyyy format.
note can specify date ticks rendering using
axes:{xaxis:{ renderer:$.jqplot.dateaxisrenderer, tickoptions: { formatstring: '%d/%m/%y %h:%m' }, }},
see more dateaxisrenderer
in jqplot documentation here.