Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble rendering Google Charts with PocketQuery

Drew Sellers December 11, 2015

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

1 vote
Answer accepted
Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 13, 2015

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)

Drew Sellers December 14, 2015

That worked. Thanks!

Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 14, 2015

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

Drew Sellers December 17, 2015

Done!

Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 17, 2015

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events