Can't get the Gantt Chart working

Hi, I'm trying to use the Gantt Chart form Google Charts but can't seem to get it to run.

Based on my investigation, it may be due to some limitations of Google Charts or the specific version you're bundling with Pocket Query (not sure if you're bundling or loading from CDN?)

What version of GChart is included? I'm using Pocket Query 2.1

 

Here's my current template content:

#set($sprintLenghtInMs = 13 * 24 * 60 * 60 * 1000)
<script type="text/javascript">
	
	PocketQuery.loadCharts(['gantt'], {
		dataTable: [
		#foreach ($story in $result)
			#set( $Int = 0 )
			#set( $year  = $story.StartDate.substring(0,4) )
			#set( $month = $Int.parseInt( $story.StartDate.substring(5,7).replaceFirst("^0+(?!$)","") ) - 1 )
			#set( $day   = $story.StartDate.substring(8,10).replaceFirst("^0+(?!$)","") )
			["$story.Id", "$story.Title", "$story.Team", new Date($year, $month, $day), null, $sprintLenghtInMs, 100, null]#if($velocityHasNext),#end
		#end
    ]
	});
</script>

 

And get the following error:


?file=visualization&v=1.0&packages=gantt&async=2:3 Uncaught Error: Module: 'visualization' with package: 'gantt' not found! 

 

Thanks for your awesome plugin!

1 answer

Hi Julien!

The Gantt Chart is currently the only chart type that is not supported by the PocketQuery API, unfortunately. There is also a note in the docs:

The Gantt chart is in beta and may be undergoing substantial revisions in future Google Charts releases.

You can't use another chart type for your purpose? If not so, there might still be a workaround. If you are good in JS programming, you can use one or more of the methods PocketQuery.queryArray(queryName), PocketQuery.queryObject(queryName), PocketQuery.queryColumns(queryName). These will return your data as JavaScript structures. Using these, you can use the Google Charts API directly as written in their example, without using PocketQuery.chart. But this will require some time experimenting with JS Code, I fear.

Let me know if you need further help!

Regards, Felix (Scandio)

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
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,775 views 26 10
Join discussion

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