Stacked Bar Chart based on Two Dimensional Filter Statistics Macro
Asked by Michael Aizicowitz:

Hi All,

Is there any way to create a Stacked Bar chart based on the results of a Two Dimensional Statistic Macro? I can get the Bar chart to work off a manual table with the Chart macro, but when I replace the table with the Two dimensional Filter Statistics Macro, it doesn't work.

Any ideas?


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

The Chart macro doesn't work with the Two dimensional Filter Statistics macro. But the [Chart from Table](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Chart+from+Table+macro) (the [Table Filter and Charts](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?hosting=cloud&tab=overview) app) macro does.

comments: author: Michael Aizicowitz
body: Hi Andrey,

Thanks for the response. Does the add-in do the following?

* Support Stacked Bar Graphs
* Allow me to define specific colours for specific Pie / Bar Chart data
* Allow for manual resorting of Table Columns?

Regards,

Michael


author: Andrey Khaneev _StiltSoft_
body: Hi Michael,

* It supports [Stacked Bar charts](https://docs.stiltsoft.com/display/TFAC/Column%2C+Stacked+Column%2C+Bar%2C+Stacked+Bar+chart+types)
* It allows [defining colors](https://docs.stiltsoft.com/pages/viewpage.action?pageId=42239751#ChartParameters-Setcolors) for each piece of data
* The order of bars is inherited from the order in the source table. So you can sort the Two Dimensional Filter Statistics macro's table to change the order of bars.


author: Michael Aizicowitz
body: Hi Andry,

We have added macro into our environment to test. I add one of the macros (table filter foe example) and save. Once this appears in my editor, I add my JIRA Two Dimensional Table Macro inside the table filter macro and save. When I open the Table Filter Macro again, it generates the following error message:

"Oops, it seems that you need to place a table or a macro generating a table within the Table Filter macro."

How do I attach my data source?


author: Andrey Khaneev _StiltSoft_
body: Hi Michael,

Here is how I configured several macros:

![2020-05-22_14h37_26.png](https://community.atlassian.com/t5/image/serverpage/image-id/95991i67B879EAA989DB47/image-size/large?v=v2&px=999 "2020-05-22_14h37_26.png")![2020-05-22_14h37_05.png](https://community.atlassian.com/t5/image/serverpage/image-id/95992i91F7510F0E82C670/image-size/large?v=v2&px=999 "2020-05-22_14h37_05.png")


author: Michael Aizicowitz
body: Thanks for the help - that worked.

Now I'm struggling with the Pie chart. I tried inserting a two dimensional table with the summary I wanted, but the generated pie chart includes the total row - not what I'm after. I then tried inserting the JIRA data using the Insert JIRA Issue/Filter, but the pie chart doesn't generate correctly. Any ideas?


author: Andrey Khaneev _StiltSoft_
body: I used Table Filter to filter out the total row:

![2020-05-22_14h37_05.png](https://community.atlassian.com/t5/image/serverpage/image-id/96191i1814D2DD6D07660F/image-size/large?v=v2&px=999 "2020-05-22_14h37_05.png")

I used the [Table Toolbox](https://docs.stiltsoft.com/display/TFAC/How+to+use+Table+Toolbox+macro?src=contextnavpagetreemode) macro to combine Table Filter and Chart from Table in the new editor:

![2020-05-25_10h49_10.png](https://community.atlassian.com/t5/image/serverpage/image-id/96192i57D731ECFC4BBAB0/image-size/large?v=v2&px=999 "2020-05-25_10h49_10.png")

I case you need to show count of each status using Jira Issues macro, then you need to use Pivot Table to count statuses:

![2020-05-25_10h55_08.png](https://community.atlassian.com/t5/image/serverpage/image-id/96194i998BEB0D3DE23EBE/image-size/large?v=v2&px=999 "2020-05-25_10h55_08.png")![2020-05-25_10h56_02.png](https://community.atlassian.com/t5/image/serverpage/image-id/96195i6F8C147825A8FB03/image-size/large?v=v2&px=999 "2020-05-25_10h56_02.png")


author: Michael Aizicowitz
body: Hi Andrey,

Thanks for your help - this is working as expected. I have a question with regard to the Table Filter. Where one of the colums is a JIRA issue (//JIRA then type in the key and display as a single issue), this appears correctly in the table after the first edit. If I then republish the table it will display the URL rather than the single issue view.

Is there any way to ensure that this display correctly - ie the single issue and not the URL?

Michael


author: Andrey Khaneev _StiltSoft_
body: Hi Michael,

This is a known issue. It comes from the fact that Confluence renders those links incorrectly for the app as well as for the PDF export. As soon as it will be fixed for the page export to PDF, it will be shown correctly inside the macro. Notice that it works correctly in the legacy editor.


author: Andrey Khaneev _StiltSoft_
body: [@Michael Aizicowitz](/t5/user/viewprofilepage/user-id/3922729), here this issue that causes Jira issues to be shown as links: [https://jira.atlassian.com/browse/CONFCLOUD-70167](https://jira.atlassian.com/browse/CONFCLOUD-70167?)


author: Michael Aizicowitz
body: Hi Andrey,

Is there any way I can set the colour of a cell in the table based on its value? As an example we have a RAG status that can be Red, Amber or Green and I'd like the cell in the table to have this colour.

I did try to use the Table Processor where I created a second table with the correct colouring and used the Lookup Tables component of the Table Transformer. I got this to work, but now have two columns in my table with the RAG status (the original extracted from Jira and the correctly coloured one from my query. Hiding the original field in the table filter results in no records returned.

Can you help?


author: Andrey Khaneev _StiltSoft_
body: Hi Michael,

There are two solutions:

1. List all needed columns in the Table Transformer: replace SELECT \* ... with SELECT 'Column A', 'Column b'...
2. Wrap the Table Transformer with the Table Filter and hide the column.


author: Andrey Khaneev _StiltSoft_
body: Hi [@Michael Aizicowitz](/t5/user/viewprofilepage/user-id/3922729) ,

We've developed and released a fix for the issue with Jira links - they should be shown as cards now.


Tags: atl-gruland

cloud