UPDATE:
Check out this Plunker I created to better showcase the issue.
There seems to be an issue with the Back link label in the chart not functioning as expected.
I'm currently facing a challenge with the AmCharts Drillup function, which should allow users to navigate back to previously displayed chart content. While I've managed to get the Drilldown function working correctly, I'm struggling with getting the Drillup functionality to work in AngularJS.
Error in Console:
https://i.stack.imgur.com/E7Mlp.png
Origin of the Error:
.........................
// add back link
// let's add a label to go back to yearly data
event.chart.addLabel(
70, 10,
"< Go back",
undefined,
13,
undefined,
undefined,
undefined,
true,
'javascript:mostSoldDrillUp();'); <------- THIS IS THE LINK LABEL FOR DRILLUP
.................................
function mostReferralsDrillUp() {
...........
...........
}
Methods I have attempted:
- I tried placing the AmChart JavaScript code inside a directive's link function, but encountered the error: Uncaught ReferenceError: mostSoldDrillUp is not defined at
:1:1 in the browser console. - I also attempted to place it within a controller, resulting in the same error.
Simply including the JavaScript file and defining the chart's id in a div within the HTML using ui-router yielded the same error.
.state('home', { url: '/', templateUrl: './pages/home.html', controller: 'HomeCtrl' })
Finally, I omitted the controller from my route definition:
.state('home', { url: '/', templateUrl: './pages/home.html', // controller: 'HomeCtrl' })
While this approach worked, I require a controller for other functionalities, rendering this method obsolete.
If anyone has encountered a similar issue or has a potential solution, your input would be greatly appreciated. Thank you.