jettro / c3-angular-directive

Contains angularjs directives that use c3js to create good looking graphs
http://jettro.github.io/c3-angular-directive/
MIT License
203 stars 98 forks source link

TypeError: a.axisTimeFormat.multi is not a function #132

Open kaizenlabs opened 8 years ago

kaizenlabs commented 8 years ago

Hello,

So I managed to get the examples working in just a plain, frontend app that was hosted on a local apache server, so this one works:

https://github.com/JohnAntonusMaximus/c3-example

However as soon as I set up the same exact app structure on the front end of a NodeJS-backed application, I keep getting the following error in the browser console when I switch to the one view with the chart in it:

TypeError: a.axisTimeFormat.multi is not a function at e.i.initParams (c3.min.js:1) at e.i.init (c3.min.js:1) at new d (c3.min.js:1) at Object.k.generate (c3.min.js:1) at ChartController.d as showGraph at c3-angular.min.js:5 at angular.js:17918 at e (angular.js:5552) at angular.js:5829(anonymous function) @ angular.js:12520(anonymous function) @ angular.js:9292(anonymous function) @ angular.js:17921e @ angular.js:5552(anonymous function) @ angular.js:5829

The only thing I can isolate it to is that is obviously Node related because it works perfectly without a Node server. I'm res.rendering the index.html page from the server, I have all my scripts in the same order on the front end, but no matter what I do, I keep getting that error in the console when I switch to the view with the chart. Please help, just spent about 6 hours on this with no progress.

haotinypulse commented 6 years ago

I used c3 version 0.4.18 and d3 version 3.5.17 to fix this issue. I think this issue happen on d3 version is slower than 3.5.7.

Lloyd-Nha commented 6 years ago

That works thank you