Can't get the Gantt Chart working

jbrassard June 3, 2016

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

0 votes
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.
June 5, 2016

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
TAGS
AUG Leaders

Atlassian Community Events