I'm trying to create a JIRA gadget that uses highcharts and I'm not being able to call in the javascript highcharts.js correctly.
The file is located at: atlassian_tutorial-jira-gadget/src/main/resources/js/HighStock/highcharts.js
The atlassian-plugin.xml has the following added to it:
<web-resource key="highstock">
<resource type="download" name = "highcharts.js" location = "js/HighStock/highcharts.js">
<property key = 'content-type' value = 'text/javascript' />
</resource>
</web-resource>
The gadget file gadget.xml has the following:
#requireResource("plugin-key:highstock")
...
<div id = "container">HighStock</div>
...
AJS.$('#container').highcharts('StockChart',{title:{text:'Test'}});
Nothing happens at all. And I get the following error in Google Chrome console:
Uncaught TypeError: Object [object Object] has no method 'highcharts'