Unable to render pie chart using Pocket Query

Hello,

I'm using Confluence 5.5.3 and PocketQuery 2.0.7

Issue:

I'm trying to render a simple pie chart but receiving error: "Pie chart should have a first column of type string."

We have a number of software releases that vary in their lifecycle status. i.e. Design, Implementation, Testing... and I'd like to produce a simple pie chart with an overview of how many releases we have in each status.

Here's my query:

SELECT COUNT(*) AS "Lifecycle Totals", [Lifecycle Status]
FROM Versions
GROUP BY [Lifecycle Status];

Here's my template:

-------------------------------------------

<script>
PocketQuery.chart('PieChart', {
  title: 'Software Lifecycles by Status',
  pieHole: 0.2
});
</script>
-------------------------------------------

When I test the query results using the default template it renders the table correctly:

Lifecycle StatusLifecycle Totals
Design12
Implementation23
Testing16

However, when I select the pie chart template using the same query it returns the error: "Pie chart should have a first column of type string."

 

I'm sure there's something simple I'm missing here... Would anyone be able to provide some guidance?

 

Thanks!

1 answer

1 accepted

This widget could not be displayed.

Hi Dan,

Thank you for your interest in PocketQuery! There is one requirement for a pie chart to work properly: the first column must be a string and the second one must be a number. While in your default result this looks correct, in your query the number is the first column. I'm wondering why the number column is the second in the default result and the string is the first. Did you try switching the order in the select clause?

SELECT [Lifecycle Status], COUNT(*) AS "Lifecycle Totals"
FROM Versions
GROUP BY [Lifecycle Status];

Regards, Felix (Scandio)

Hi Felix,

Yes, I switched the order in the SELECT clause and the pie chart renders correctly. Thank you very much for your response!

Thanks!

 

P.S. This is a great add-on and I've left a review on the marketplace.

I saw it! Thank you for the great review! smile

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

134 views 16 7
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