Help with writing a gadget for jira dashboard

I’m trying to create a gadget for jira dashoard but I find it hard to understand or find the right tutorials or guides to continue developing, there are so many tutorials and I don’t know where to start.

I’ve set up the environment and got a simple ‘Hello World!’ text showing up in my gadget. I want to do something similar to the ‘Created vs. Resolved Chart’ gadget that is included in jira source code, it shows resolved issues vs created issued.

I would like start off with rendering something basic in my gadget and later on to render a bar-chart. Then lastly go for the REST API or the JQL-queries to retrieve information to put in the graph. Tips are much appreciated!