Grid Trekkor Report post Posted October 25, 2015 (edited) I'm dynamically creating some data: month.dataset[2].data.push({ "value" : data.data[k].Hi.toString(), "link" : "JavaScript:displayDay(" + (k+1) + ")" }); k is the iterator. Here is my displayDay function. This does not work. I get Uncaught ReferenceError: displayDay is not defined: function displayDay(day) { console.log(day); } But this works: month.dataset[2].data.push({ "value" : data.data[k].Lo.toString(), "link" : "JavaScript:console.log(" + (k+1) + ")" }); It logs the value to the console as it should. Any idea why the above function doesn't work? Thank you. Edited October 25, 2015 by Grid Trekkor Share this post Link to post Share on other sites
Grid Trekkor Report post Posted October 25, 2015 (edited) EDIT: I did get it to work by moving displayDay() to the top of the JS file (outside my Angular controller), but then Angular no longer has access to it, so I'm not sure how to fix that. On the other hand, if I define the function using $scope, then I get the same error: Uncaught ReferenceError: $scope is not defined - fusioncharts.js:155 Edited October 25, 2015 by Grid Trekkor Share this post Link to post Share on other sites
Vishalika Report post Posted October 25, 2015 Hi, Please confirm if you are using the Angular JS plugin of FusionCharts for this implementation. Awaiting response. Share this post Link to post Share on other sites
Grid Trekkor Report post Posted October 25, 2015 (edited) Hi, thank you for the reply. Yes, I've sourced the AngularJS plugin locally like this: <script type="text/javascript" src="/javascripts/angular.min.js"></script> <script type="text/javascript" src="/javascripts/jquery.min.js"></script> <script type="text/javascript" src="/javascripts/fusion/fusioncharts.js"></script> <script type="text/javascript" src="/javascripts/fusion/angular-fusioncharts.min.js"></script> I managed to get it working by adding jQuery, but it seems like I shouldn't have to do that. Edited October 25, 2015 by Grid Trekkor Share this post Link to post Share on other sites
Moonmi Sonowal Report post Posted October 26, 2015 Hi, Could you please check out the fiddle: http://jsfiddle.net/moonmi/hxsm9ow5/ ? It uses the latest plugin and js files. Please do share your observations. Thanks. Share this post Link to post Share on other sites