Reputation: 1
I'm using last dygraphs library with basic html provided in the example. As csv i've uploaded a custom one with data in format DD/MM/YYYY HH:MM:SS The graphs scales correctly but no plots are displayed. Also Chrome reports lots of
dygraphs: Couldn't parse 22/05/2014 21:00:45 as a date (dygraph-combined.js:2:8358)
Example available here http://atelierelealbe.eu/temp/datatemp.htm Any ideea of what am i doing wrong?
Upvotes: 0
Views: 2428
Reputation: 181
I solved this problem by changing errorBars option to false (or you may delete errorBars option because default value of this variable is false).
Upvotes: 1
Reputation: 24738
I believe the automatic date parsing does not recognize that format for dates.
If you have control of the CSV, change the date format to yyyy/mm/dd
If not, use the xValueParser option and some javascript to parse the date.
See this documentation: http://dygraphs.com/data.html
If you decide to go with the parser, moment.js is a great library for date manipulation: http://momentjs.com/
xValueFormatter: Dygraph.dateString_,
xValueParser: function(x) {
var m = moment(x, "DD-MM-YYYY HH:mm:ss");
return m.toDate().getTime();
},
xTicker: Dygraph.dateTicker
Working DEMO
Upvotes: 2