Confluence Pie Chart auto updates the counts of complete versus open tasks WITHIN a given page
Asked by Michael Hudson:

I have a single confluence page for on-boarding a new program manager. Embedded in this page are tasks to complete. I would like to create a Pie Chart that keeps count of completed versus open (as the PM checks off tasks, the chart updates totals).

I think I need to create a table first then the chart but I don't know how to automate the count macro. Thanks.


Answers:
author: Andrey Khaneev _StiltSoft_
body: Hello Michael,

Here is a solution:

1. Add some label to pages with tasks you want to see in the Pie chart report ![2019-01-09_13h59_15.png](https://community.atlassian.com/t5/image/serverpage/image-id/42001i21A1C8B2F1C9C8ED/image-size/large?v=v2&px=999 "2019-01-09_13h59_15.png")
2. Add Those macros to the page where you want to see the Pie chart: two [Task Report](https://confluence.atlassian.com/doc/task-report-macro-590260009.html) macros with the label (one for incomplete tasks and one for completed), [Pivot Table](https://docs.stiltsoft.com/display/public/TableFilter/How+to+use+Pivot+table+macro) macro and [Chart from Table](https://docs.stiltsoft.com/display/public/TableFilter/How+to+use+Chart+from+Table+macro) macro ([Table Filter and Charts](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?hosting=cloud&tab=overview) app) ![2019-01-09_14h02_32.png](https://community.atlassian.com/t5/image/serverpage/image-id/42002i2E86508D75754B6C/image-size/large?v=v2&px=999 "2019-01-09_14h02_32.png")![2019-01-09_14h02_45.png](https://community.atlassian.com/t5/image/serverpage/image-id/42003i78348C5129E5893F/image-size/large?v=v2&px=999 "2019-01-09_14h02_45.png")![2019-01-09_14h03_01.png](https://community.atlassian.com/t5/image/serverpage/image-id/42004iCF47FDAC60F372EE/image-size/large?v=v2&px=999 "2019-01-09_14h03_01.png")
3. Save the page and set "Description" column in **Row labels** field of the Pivot Table macro and save changes![2019-01-09_14h02_03.png](https://community.atlassian.com/t5/image/serverpage/image-id/42005iB4D3F9C8F72EFA98/image-size/large?v=v2&px=999 "2019-01-09_14h02_03.png")
4. Additionally you can hide source table in the Pie chart ![2019-01-09_14h02_23.png](https://community.atlassian.com/t5/image/serverpage/image-id/42006i65047233E4D093D8/image-size/large?v=v2&px=999 "2019-01-09_14h02_23.png")

comments: author: Fernanda Luksic
body: Hi,

I cannot seem to get the Pivot Chart into the Chart from Table macro. Please suggestions. I have tried everything (copy paste, drag). It only lets me put the track report in the Pivot Chart and that is it.

Help!


author: Andrey Khaneev _StiltSoft_
body: Hi [@Fernanda Luksic](/t5/user/viewprofilepage/user-id/3869582),

I suppose you are using Confluence Cloud where the new editor doesn't allow to use nested bodied macros. In this case, use the [Table Toolbox](https://docs.stiltsoft.com/display/TFAC/How+to+use+Table+Toolbox+macro) macro.


author: Fernanda Luksic
body: Thank you! This worked perfectly!


author: Fernanda Luksic
body: Hi [@Andrey Khaneev _StiltSoft_](/t5/user/viewprofilepage/user-id/781696) ,  

I was wondering if you know a little more about sorting the data here. I want to potentially create a report to see how we are doing as a company in terms of completion of tasks. Do you know if I can sort the completed/incompleted tasks in other ways? like date, label?

Thank you in advance for your help!


author: Andrey Khaneev _StiltSoft_
body: Hi [@Fernanda Luksic](/t5/user/viewprofilepage/user-id/3869582),

There are three sorting options in the Task Report macro:

![2020-08-20_11h41_22.png](https://community.atlassian.com/t5/image/serverpage/image-id/107319i3A7F81FCDF40D389/image-size/large?v=v2&px=999 "2020-08-20_11h41_22.png")

Or you can wrap Task Report macros with the [Table Transformer](https://docs.stiltsoft.com/display/TFAC/How+to+use+Table+Transformer+macro) macro and sort it by any column:

![2020-08-20_11h45_49.png](https://community.atlassian.com/t5/image/serverpage/image-id/107321i9116B17815665D67/image-size/large?v=v2&px=999 "2020-08-20_11h45_49.png")

```
SELECT * FROM T1 ORDER BY T1.'Description'
```


author: Fernanda Luksic
body: Thank you Andrey. I have a few more questions and will not bother you again! After I sorted the data with the three labels is there a way to sort (so to show in the same table) like sort by date + sort by completed and incompleted so as to show for the same date how many are completed or not. So basically sort by two types. Does this make sense?

Please let me know!

Thank you!!


author: Andrey Khaneev _StiltSoft_
body: You are welcome, Fernanda!

I suppose you can create a Pivot Table to show the number of completed and incomplete tasks for each date:

![2020-08-21_18h17_32.png](https://community.atlassian.com/t5/image/serverpage/image-id/107528i7B03462BBC9FB5BC/image-size/large?v=v2&px=999 "2020-08-21_18h17_32.png")

Then you can build a chart on the basis of the pivot table.


author: Shannon S
body: Michael,

You might be able to use something like [SQL for Confluence](https://marketplace.atlassian.com/apps/225/sql-for-confluence-pro-edition?hosting=server&tab=overview) to connect to the database, query the number of tasks on the specific page (using pageID), and display this information (completed and incomplete) in the form of a pie chart.

Have a look at that add-on and let us know if you have any questions.

Regards,

Shannon


Tags: atl-adm

atlassian-marketplace

confluence-server