amcharts3-react icon indicating copy to clipboard operation
amcharts3-react copied to clipboard

d.AmStockChart is not a constructor

Open salmanmuneer007 opened this issue 5 years ago • 1 comments

Uncaught TypeError: Cannot read property 'date_time' of undefined at eval (eval at (jquery.min.js:2), :18:73) at eval () at jquery.min.js:2 at Function.globalEval (jquery.min.js:2) at Ha (jquery.min.js:3) at n.fn.init.append (jquery.min.js:3) at n.fn.init. (jquery.min.js:3) at Y (jquery.min.js:3) at n.fn.init.html (jquery.min.js:3) at Object.success (apps:3628)

Uncaught TypeError: Cannot set property 'innerHTML' of null at b.write (amstock.js:6) at ammap.js:10 at d.handleLoad (amcharts.js:7)

Uncaught TypeError: Cannot set property 'innerHTML' of null at b.write (amstock.js:6) at ammap.js:10 at d.handleLoad (ammap.js:7)

salmanmuneer007 avatar Dec 13 '18 06:12 salmanmuneer007

There might be several things going on but it's hard to say going by just a stack trace.

A few things that stand out -

  • d.AmStockChart is not a constructor sounds like you're not including the stock chart. Note that the order is amcharts.js, serial.js, then amstock.js

  • I'm seeing both amstock and ammap in the last part of your stack trace. When using both charts and maps, you need to include ammap_amcharts_extension.js instead of ammap.js. amcharts.js and ammap.js both override each other's functions, which impacts functionality, leading to random errors like this; ammap_amcharts_extension.js extends the classes in amcharts.js to implement map-related functionality without overriding existing functionality. Note that his needs to be included after amcharts.js.

  • Cannot set property 'innerHTML' of null means the corresponding div isn't on the page yet. If you're using the plugin, this shouldn't happen unless you're calling makeChart yourself. It's hard to troubleshoot without seeing a demo. Please provide a simplified version of your setup in codesandbox or stackblitz.

xorspark avatar Dec 13 '18 14:12 xorspark