Trouble rendering Google Charts with PocketQuery

I'd like to create a Google Gantt chart, using PocketQuery, to illustrate JIRA version durations. However, I've had no success. Are Gantt charts supported in PocketQuery?

As an alternative, I've created the charts using Timelines, but I've run into issues here, as well. I seem to be having problems with the date format. The only query, which has resulted in a successful rendering, returns the date as seconds since year 0, e.g. 

SELECT vname, to_seconds(startdate), to_seconds(releasedate)
FROM projectversion

This is fine, other than the x-axis showing hours of the day, rather than date. What date formats are acceptable? When not using seconds, I receive an error which states "date, number, or datetime" must be used, but converting startdate and releasedate to the date format doesn't work either. 

1 answer

1 accepted

Hi Drew,

Thank you for your interest in PocketQuery! I just checked this and sadly, I found that Gantt charts are currently not usable with the PocketQuery JS API. I will provide a fix for that in the next version.

You should be able to use the Timeline chart type for your example. But you'll have to work a little with the PQ JS API to make it work. I reproduced your issue locally and I found this to work fine for me...

Query:

SELECT vname, startdate, releasedate FROM projectversion;

Template:

<script>
(function() {
  var result = PocketQuery.queryArray();
  var dataTable = [['Column1', 'Column2', 'Column3']];
  jQuery.each(result, function(index, row) {
    dataTable.push([row.vname, new Date(row.startdate), new Date(row.releasedate)]);
  });
  PocketQuery.chart('Timeline', {
    dataTable: dataTable
  });
}())
</script>

Does this work for you?

Regards, Felix (Scandio)

That worked. Thanks!

Glad to hear that! If you like PocketQuery, would you consider leaving a review at the marketplace? :)

Thanks a lot for the really awesome review, Drew!!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

361 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you