GraFiddle / angular-chart

AngularJS directive for adjustable dynamically updating c3 charts
http://grafiddle.github.io/angular-chart/
MIT License
127 stars 40 forks source link

Failed to parse x '2016-06-29 04:10:01' to Date object #117

Open 81n90 opened 8 years ago

81n90 commented 8 years ago

Failed to parse x '2016-06-29 04:10:01' to Date object c3 error i.parseDate@c3.min.js

Have data like this { value: '10', myTime: '2016-06-29 04:10:01' }, { value: '7', myTime: '2016-06-29 04:11:01' }, { value: '14', myTime: '2016-06-29 04:17:01' }

and dimensions like this:

myTime { axis: 'x', dataType: 'datetime', displayFormat: '%Y-%m-%d %H:%M:%S', } I need graph with axis x like this: 00:00 00:30 01:00 ... etc. step every 30 minutes, but have random timed data. in axis tick, I use format: format: function (d) { var item = $scope.options.data[d]; return d3.time.format('%H:%M')(new Date(item["myTime"])); } How to add x region? When try to add x region like '00:30' - it is not work without errors, start/end with d3.time.format('%H:%M')(new Date("2016-06-29 04:11:01")) also not work. on y axis simle integer data works properly