How to hide a google chart in pocketquery when there is no data?

Cuto Calleja
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.
March 31, 2016

I would like to avoid the anoying google chart message when the query returns no data...

Any idea?

Thanks in advance!

1 answer

1 accepted

0 votes
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.
March 31, 2016

Hi Cuto!

Try like this:

#if (!$result.isEmpty())
	## do your normal template stuff here
	<script>
	PocketQuery.chart('BarChart');
	</script>
#else
	## do what you want to if the result is empty
	<p>The result is empty so there is no chart</p>
#end

Regards, Felix

Cuto Calleja
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.
March 31, 2016

Excellent! It works! wink

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events