Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Issue with PocketQuery Templating with Google Charts

Chris Yetter November 30, 2015

I'm having some issues with adding a tooltip to a Google Line Chart.  Here's what I have setup:

Query:

select date Date,  total  Total, 'example tooltip' from table

Results:

2014-05-01	255	example tooltip
2014-06-01	1232	example tooltip
2014-07-01	1981	example tooltip

Pocket Query Template:

<script>
PocketQuery.chart('LineChart', {
 height:700,
 width:1000,
 displayMode: 'text',
 pointSize: '3',
data.addColumn({type: 'string', role: 'tooltip'});
});
</script>

The issue is, the pocketquery results are blank.  I also don't see anything in the preview stack trace.  

 

Any ideas what I'm doing wrong?

Thanks!

3 answers

1 accepted

2 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.
December 4, 2015

Hi Chris,

please check out version 2.0.1 from the marketplace. There is now a callback JS function beforeDraw in the chart method that you can use to manipulate the dataTable object before the chart is drawn.

Example query:

SELECT Name, LifeExpectancy, GovernmentForm
FROM Country
WHERE LifeExpectancy IS NOT NULL
AND Continent = :Continent
AND Population > :MinPopulation

Example template:

<script>
PocketQuery.chart('BarChart', {
	showTip: true,
	beforeDraw: function(dataTable, options) {
		dataTable.setColumnProperty(2, 'role', 'tooltip');
	}
});
</script>

The setColumnProperty call says "please make my column 2 the tooltip" (starting with 0). So in my query, the column "GovernmentForm" will become the tooltip.

Let me know if this helps!

Regards, Felix (Scandio)

0 votes
Chris Yetter December 4, 2015

Felix,

Thanks!  That worked perfectly.  I really appreciate the help and the upgrade to 2.x.

 

Chris

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 6, 2015

Hi Chris! Thanks for the feedback! Would you mind to contribute to the PocketQuery community and mark my answer as accepted? And would you mind leaving a review for PocketQuery at the marketplace?

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.
December 3, 2015

Hi Chris! Just wanted to let you know I've seen this. It's actually not that straight-forward. I'll let you know about a solution during the next days. I'm interested in this very much myself ;)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events