Gadget not seeing Chart.js

Timothy McClain January 22, 2018

The gadget I am writing is giving an odd error. When loaded into my JIRA instance, the gadget loads, can be given a filter, and will run, however the bar graph it's supposed to create fails to load.

Looking in the Chrome debugger, I see this error: "Uncaught ReferenceError: Chart is not defined"

At this line: gadgets.window.myBar = new Chart(ctx, { ... })

However I do load Chart.js in my atlassian-plugin.xml and pull that resource into the gadget using:
#requireResource("path.jira-plugin:jira-gadget-resources")

I do also use: #requireResource("com.atlassian.jira.gadgets:common")

1 answer

0 votes
Timothy McClain January 23, 2018

I should add the line previous to the error defines ctx as:

var ctx = document.getElementById("chart").getContext("2d");

Suggest an answer

Log in or Sign up to answer