Combination Pie Chart with JQL tables
Asked by Matt Wilson:

My goal is to have a single PIE chart that will produce a percentage based on values from two tables being fed by JQL.

JQL1 - produces story points  
JQL2 - produces bugs

I'll need to total both JQL1 and JQL2, which seems to be no issue but produces 2 pie charts, and then have the final pie chart complete:

JQL2 / JQL1

to show defect density as a pie chart percentage


Answers:
author: Tom Harris - Old Street
body: Hi [@Matt Wilson](/t5/user/viewprofilepage/user-id/3923789) ,

This should be possible using our app [Custom Jira Charts for Confluence](https://marketplace.atlassian.com/apps/1220493/custom-jira-charts-confluence-reports). It's a charting and reporting macro that allows you to create custom reports in seconds.

Using the Custom JQL feature you can total any values you need directly on the pie chart without writing any additional code.

You can also change the COUNT selector to change the count from Issues to Story Points, or any other value you need.

![Custom JQL Pie CHart.png](https://community.atlassian.com/t5/image/serverpage/image-id/114214i57C0001C83298528/image-dimensions/588x299?v=v2 "Custom JQL Pie CHart.png")

You can try this right now for yourself on our interactive app playground: <https://www.oldstreetsolutions.com/jira-reporting-playground>

I hope that helps answer your question ?

Kind regards,

Tom

Custom Charts Product Manager


author: Katerina Kovriga {Stiltsoft}
body: Hi [@Matt Wilson](/t5/user/viewprofilepage/user-id/3923789) ,

You may check the [Table Filter and Charts for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?hosting=server&tab=overview) app.

You'll need to wrap your Jira Issues macros and an additional mini-table first into the [Table Transformer](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Transformer+macro) macro and then into the [Chart from Table](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Chart+from+Table+macro) macro.

![Transformer 1.png](https://community.atlassian.com/t5/image/serverpage/image-id/114207i1E1943642C292D27/image-size/large?v=v2&px=999 "Transformer 1.png")The first step is to sum your story points and count the number of your bugs. If I've got your case slightly wrong, keep in mind that it is just an example and the Table Transformer macro allows you to perform various kinds of calculations.

![Transformer 2.png](https://community.atlassian.com/t5/image/serverpage/image-id/114208iB6F044E540842A7D/image-size/large?v=v2&px=999 "Transformer 2.png")Here is the SQL query for you to copy:

SELECT (SELECT T1.'Issue Summary' from T1) as 'Issue Summary',  
(SELECT SUM(T2.'story points') from T2) as 'Total Stories',  
(SELECT COUNT(T3.'Key') from T3) as 'Total Bugs'

![Transformer 3.png](https://community.atlassian.com/t5/image/serverpage/image-id/114209i94A776A6CC1CFE7F/image-size/large?v=v2&px=999 "Transformer 3.png")

Now let's create the required Pie chart:

![Transformer 4.png](https://community.atlassian.com/t5/image/serverpage/image-id/114210i1C25B0CB1B084EDD/image-size/large?v=v2&px=999 "Transformer 4.png")![Transformer 5.png](https://community.atlassian.com/t5/image/serverpage/image-id/114211i1CCF60BA68D8BAEA/image-size/large?v=v2&px=999 "Transformer 5.png")If you visit our documentation (I've given links at the beginning of the response), you'll see a lot of different use cases: our macros are flexible and can be combined differently to simplify and visualize custom reports.


Tags: confluence-server

server