nvd3.js - convert date to unix time stamp in nvd3 x-axis -
here i'm getting date 1970-01-01 default.can please me out in converting "2015-10-01" timestamp.
my date :
"date": "2015-10-01" xaxis: { axislabel: 'months', ticks: d3.time.months, tickformat: function (d) { return d3.time.format('%y %b')(new date(d)); }
i did thing,which solved issue
x: function (d) { return d3.time.format('%y-%m-%d').parse(d.date); }, y: function (d) { return d.trendingvalue; }, useinteractiveguideline: true, xscale: d3.time.scale(), xaxis: { axislabel: 'months', ticks: d3.time.months, tickformat: function (d) { return d3.time.format('%y-%m-%d')(new date(d)); } }
Comments
Post a Comment