Sort Chart data in Chart from table

ksweeney March 4, 2024

I have a table with columns showing different runs and rows showing the results for accuracy, precision, recall and F1 score. I have my table within a "Table Excerpt".

 

I then have a "Chart from table" macro, which has a "Table Excerpt Include" macro inside. (see below)

Screenshot 2024-03-04 at 16.40.04.png

The values are then shown in the chart are ordered alphabetically as shown (Column names left out)

Screenshot 2024-03-04 at 16.37.22.png

I want to be able to order the results on Precision so the chart for precision will go from largest to smallest and then all others (i.e. Accuracy, Recall and F1) will then just follow the sorting order. 

 

I am a complete newbie to Confluence so please either excuse the simple question or reply explaining all required steps.

 

Many thanks!

1 answer

1 accepted

2 votes
Answer accepted
Stiltsoft support
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.
March 5, 2024

Hi @ksweeney ,

The macro works as expected, it's a standard behavior.

Not sure if the case can be implemented in general because, as I see, for the Accuracy field it may be ABCDE, for Precision - CBDAE, for Recall - EBDAE and so on. The original table can't be even sorted in a way to maintain "from largest to lowest" separately for each field.

The workaround may be to break your table by fields and create a separate chart for each field.

ksweeney March 5, 2024

Many thanks for the reply. I do not require it to be different for each field. Just sorted based on Precision (for example) and then all fields being sorted by CBDAE (as you say)

Stiltsoft support
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.
March 5, 2024

Not sure that I've understood your last sentence correctly: I mean that you can't display several fields on the same chart for which the ABCDE sequences may be different.

You can transpose your table, make the metrics not rows but columns, then reuse your table several times and display only one metric (one column) every time. Then this one column with metric can be sorted and displayed separately on its separate chart.

ksweeney March 5, 2024

Apologies for the confusion. I do not want the sequences to be different.

Currently they are all the same and ordered alphabetically. I want them all the same but ordered by Precision value. 

Stiltsoft support
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.
March 5, 2024

I think this case won't be also possible: as I understand, you use a Bar chart. The 'Metric' column goes to the 'Labels column' field and for the 'Values' column you manually select the A, B, C, D, ... columns.

So, you may just adjust their sequence as you need manually. 

Like ksweeney likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events