JIRA Gadget Plugin with HighCharts -
i'm trying create jira gadget uses highcharts , i'm not being able call in javascript highcharts.js correctly.
the file located at: atlassian_tutorial-jira-gadget/src/main/resources/js/highstock/highcharts.js
the atlassian-plugin.xml has following added 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 following:
#requireresource("plugin-key:highstock") ... <div id = "container">highstock</div> ... ajs.$('#container').highcharts('stockchart',{title:{text:'test'}});
nothing happens @ all. , following error in google chrome console:
uncaught typeerror: object [object object] has no method 'highcharts'
- check you're including jquery aui in gadget
- check you've referenced highcharts correctly
get url of rendered gadget xml , check correctly calling jquery via #requireresource("com.atlassian.gadgets:common-resources")
, highcharts in xml file. if spot problems, update atlassian-plugin.xml
corrected paths
more on using web resources in gadget.
edit: if javascript file located @ /main/src/resources/js/highstock/highcharts.js
snippet of atlassian-plugin.xml
should work:
<web-resource key="highstock"> <resource type="download" name="highcharts.js" location="/js/highstock/highcharts.js" /> </web-resource>
note i've removed spaces in attribute = "value"
bits had; prefixed location attribute value /
Comments
Post a Comment