Bug 162969 - PivotChart column/data series order not updated when sorting PivotTable columns/rows resp.
Summary: PivotChart column/data series order not updated when sorting PivotTable colum...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Pivot-Table Pivot-Chart
  Show dependency treegraph
 
Reported: 2024-09-14 20:34 UTC by Eyal Rozenberg
Modified: 2024-10-15 22:11 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Document with data, a PivotTable and a PivotChart (27.36 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-09-15 18:50 UTC, Eyal Rozenberg
Details
Sorting by Sum - This Year (25.41 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-09-16 14:21 UTC, m_a_riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2024-09-14 20:34:25 UTC
Suppose you have a PivotTable with at least two rows and two columns of data. If you create a PivotChart for that table - say, a Stacked Columns chart - and then change the row sort order using Data... > Sort - the data series in the chart will retain the same order. They should be reordered according to the change to the PivotTable.
Comment 1 m_a_riosv 2024-09-15 00:12:31 UTC
Please attach a sample file, reduce the size as much as possible without private information.
Comment 2 Eyal Rozenberg 2024-09-15 18:50:04 UTC
Created attachment 196459 [details]
Document with data, a PivotTable and a PivotChart

Try sorting by either rows or columns, so that the order actually needs to change; the PivotTable will change, the PivotChart will not.
Comment 3 m_a_riosv 2024-09-16 01:14:48 UTC
If I change the order for the 'Status' field, it is updated on the pivot chart.

PT has their own way to sort, so sorting out of the PT do nothing, because nothing is changed in the PT, and nothing change for the PT-Chart.
Comment 4 Heiko Tietze 2024-09-16 08:54:32 UTC
Whether PT are supposed to work as ordinary charts is discussed in bug 162968. If changing the data series is possible, meaning there is no good reason to prevent this, we should also allow to manipulate the chart details. So kind of depends on.
Comment 5 Eyal Rozenberg 2024-09-16 09:43:17 UTC
(In reply to m_a_riosv from comment #3)
> If I change the order for the 'Status' field, it is updated on the pivot
> chart.

Only if you use the PivotTable control for doing so, not if you sort the data, and probably not if you otherwise change the order.

> PT has their own way to sort, so sorting out of the PT do nothing, because
> nothing is changed in the PT, and nothing change for the PT-Chart.

That could have been true, except that LibreOffice is willing to take a Data > Sort... request from within a PT - and moreover, selects the PivotTable, indicating that it recognizes the action: "Oh, you must want to change the PivotTable sort order; let us do that then".

Now, you could say: I would rather the Sort command just fail outright for PTs. And that would at least guarantee consistent behavior and not confuse the user. However, it is not currently possible (correct me if I'm wrong) to sort the PT based on data columns; or to control a complex sort order at once (as opposed to setting the sort order separately for each column. So there is need/benefit for using the sort dialog - and it is better IMNSHO to make sure it behaves properly and the resort results propagate.

Note that even though bug 162968 mentions rows and columns and data series, it's about something quite different; they are independent: Even if one could change the sort order, that does not mean one can have charts with row rather than column data series, and vice-versa.
Comment 6 m_a_riosv 2024-09-16 14:21:32 UTC
Created attachment 196487 [details]
Sorting by Sum - This Year
Comment 7 Eyal Rozenberg 2024-09-16 14:50:15 UTC
(In reply to m_a_riosv from comment #6)
How was the sort triggered?
Comment 8 m_a_riosv 2024-09-16 20:55:24 UTC
Editing the row field properties.
Comment 9 Eyal Rozenberg 2024-09-16 21:16:09 UTC
(In reply to m_a_riosv from comment #8)
> Editing the row field properties.

1. How, exactly?
2. Ok, so - applying Data > Sort... should have the same result