Bug 162968 - When inserting PivotChart, can't choose data series in rows/columns
Summary: When inserting PivotChart, can't choose data series in rows/columns
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks: Pivot-Table Pivot-Chart
  Show dependency treegraph
 
Reported: 2024-09-14 20:23 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 and a PivotTable (19.52 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-09-15 17:37 UTC, Eyal Rozenberg
Details
Document with data and a PivotTable (19.52 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-09-15 18:01 UTC, Eyal Rozenberg
Details
Document with data and a PivotTable (27.21 KB, application/vnd.oasis.opendocument.spreadsheet)
2024-09-15 18:19 UTC, Eyal Rozenberg
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:23:17 UTC
When we insert a chart, the dialog allows us to choose whether we want the different data series in the chart to be the rows or the columns of the selected sheet region. However - when inserting a chart _for a PivotTable_, we don't have that choice (as we can't access the "Data Range" horizontal tab of the dialog). We should have it.
Comment 1 m_a_riosv 2024-09-15 00:11:36 UTC
I guess the PT is made for the graph, can't it go from row to column or vice versa?
Comment 2 Eyal Rozenberg 2024-09-15 06:48:57 UTC
(In reply to m_a_riosv from comment #1)
> I guess the PT is made for the graph, can't it go from row to column or vice
> versa?

Well...

1. The PT may be made both for viewing textually and graphically (that was my specific case).
2. You could make the same point about non-PT tables
3. It may be the case that you have more data series than points in a series. For example, you have a stacked column with 10 budget-rubriques for each of two years which you're comparing. And their titles are pretty long. I wouldn't want that table to have 10 wide columns of 2 elements each.
Comment 3 Regina Henschel 2024-09-15 11:30:07 UTC
Eyal, could you please attach an example document with data, pivot table and a chart?
Comment 4 Eyal Rozenberg 2024-09-15 17:37:13 UTC
Created attachment 196456 [details]
Document with data and a PivotTable

Try to create a(nother) columns chart for the PivotTable; you'll find you can only use the columns as data series, not the rows.
Comment 5 Eyal Rozenberg 2024-09-15 18:01:17 UTC
Created attachment 196457 [details]
Document with data and a PivotTable

Sorry, I meant to give a stacked-column chart as an example (for greater dramatic effect, not for any technical reason).
Comment 6 Regina Henschel 2024-09-15 18:09:23 UTC
(In reply to Eyal Rozenberg from comment #5)
> Created attachment 196457 [details]
> Document with data and a PivotTable

?? The document has no PivotTable.
Comment 7 Eyal Rozenberg 2024-09-15 18:19:05 UTC
Created attachment 196458 [details]
Document with data and a PivotTable

Sorry, try it now please. I'm clumsy today.
Comment 8 Regina Henschel 2024-09-15 22:53:56 UTC
This behavior is by design, so it is an enhancement request not a bug report. The current behavior is documented in the help:
"The data range and the data series pages of the chart wizard are not enabled. They are controlled by the pivot table."
https://help.libreoffice.org/24.8/en-US/text/scalc/guide/pivotchart_create.html

Nevertheless it is a valid request.

Workaround: Change the pivot table or create a second pivot table with a suitable arrangement of columns and rows.
Comment 9 Eyal Rozenberg 2024-09-15 23:21:01 UTC
(In reply to Regina Henschel from comment #8)
> This behavior is by design, so it is an enhancement request not a bug
> report. 

I disagree... what makes something a bug rather than an enhancement request can be an error in the implementation of the intended behavior - but it can also be a feature which is usable in principle but artificially made unavailable; or behavior which frustrates the user's intent; or lack of implementation of necessary behavior etc.

In this case, the decision to limit the choice of data series axis - is a design mistake. But - I suppose it is a minor bug, considering the workarounds.
Comment 10 m_a_riosv 2024-09-16 01:38:18 UTC
(In reply to Eyal Rozenberg from comment #9)
> ...
What a lack of respect. How boring it is to see some people talking about what they don't know as if they do.
Comment 11 Heiko Tietze 2024-09-16 08:50:37 UTC
(In reply to Regina Henschel from comment #8)
> Nevertheless it is a valid request.
So let's accept it. needsDevAdvice for insights why this has not been done in first place.
Comment 12 Eyal Rozenberg 2024-09-16 09:02:55 UTC
(In reply to m_a_riosv from comment #10)
> What a lack of respect. How boring it is to see some people talking about
> what they don't know as if they do.

Such a helpful and friendly comment!

Anyway, I will suggest you read, for example, this:

https://bootcamp.uxdesign.cc/bugs-in-code-lets-talk-design-bugs-8a7ebf30c8e5

it's about visual design rather than UX design, but the point is the same.
Comment 13 Tomaz Vajngerl 2024-09-16 13:06:07 UTC
A PivotChart always reflects the layout of a PivotTable - this is not something you can freely choose only for the PivotChart. You have to modify the PivotTable layout to influence the PivotChart.

It is however true that we could have a PivotTable internal to PivotChart, so it wouldn't be shown anywhere in any spreadsheet, but PivtoChart would use it to show the data. This is not possible in LibreOffice currently and is not easy at all to do. Also to make this possible we would need to modify the UI. The Data Series tab/dialog of a chart would need to be replaced with the PivotTable dialog (with a different terminology - Row fields and Column fields would become Axis and Legend) and make the PivtoTable options more integrated into the Chart. Again not at all an easy thing to do.
Comment 14 Eyal Rozenberg 2024-09-16 14:01:49 UTC
(In reply to Tomaz Vajngerl from comment #13)
> A PivotChart always reflects the layout of a PivotTable - this is not
> something you can freely choose only for the PivotChart. You have to modify
> the PivotTable layout to influence the PivotChart.

Of course the chart reflects the layout. But - there are multiple ways of reflecting the layout. Just like one can reflect it as independent pairs of points (X-Y scatter), one can reflect it as several series-in-columns, or several series-in-rows, and it's still a reflection.

> It is however true that we could have a PivotTable internal to PivotChart,
> so it wouldn't be shown anywhere in any spreadsheet, but PivtoChart would
> use it to show the data. This is not possible in LibreOffice currently and
> is not easy at all to do.

That is not the ask here, it's a possible implementation approach, but you're saying it's not easy/possible right now. So let's not do that. Just - please allow the PivotChart to consider either rows or columns as data series, per the user's choice - just like with regular charts. This - while keeping the link between the chart and the table.
Comment 15 Tomaz Vajngerl 2024-09-16 15:28:06 UTC
(In reply to Eyal Rozenberg from comment #14)> 
> Of course the chart reflects the layout. But - there are multiple ways of
> reflecting the layout. Just like one can reflect it as independent pairs of
> points (X-Y scatter), one can reflect it as several series-in-columns, or
> several series-in-rows, and it's still a reflection.

Yes, I should've said that it reflects the layout in a specific way. 
 
> That is not the ask here, it's a possible implementation approach, but
> you're saying it's not easy/possible right now. So let's not do that. Just -
> please allow the PivotChart to consider either rows or columns as data
> series, per the user's choice - just like with regular charts. This - while
> keeping the link between the chart and the table.

Deviating from the way the PivotChart reflects the data would create a interoperability nightmare for no good reason - this is why I have not even considered that as an viable option.

The work around is clear: change the PivotTable layout. You want to show the PivotChart differently than the PivotTable - create another PivotTable and use that for the PivotChart.
Comment 16 Eyal Rozenberg 2024-09-16 21:35:32 UTC
(In reply to Tomaz Vajngerl from comment #15)
> Deviating from the way the PivotChart reflects the data 

We just agreed that PivotCharts, even now, do not reflect the data in a single way. XY-scatter charts reflect it one way, Column charts reflect it another way. Thus, creating by-row rather than by-column data series charts is not a deviation from "the" way; it's just yet another way.

> would create a interoperability nightmare for no good reason

What interoperability issues do you foresee, and between what?
Comment 17 Tomaz Vajngerl 2024-09-19 09:35:13 UTC
(In reply to Eyal Rozenberg from comment #16)
> We just agreed that PivotCharts, even now, do not reflect the data in a
> single way. XY-scatter charts reflect it one way, Column charts reflect it
> another way. Thus, creating by-row rather than by-column data series charts
> is not a deviation from "the" way; it's just yet another way.

No, that's the representation of the data that is different. It reflects the data in a way that row fields are (main) axis data and column fields are each its own data series. That stays the same independent on the type of the chart.   

> What interoperability issues do you foresee, and between what?

OOXML interoperability issue between LO and MSO (and other editors that can read OOXML and support PivotCharts). To reflect the data in a different way would need a LO specific extension to the standard (or a solution to put the PivotTable internal to the PivotChart - which brings this back to the first possible solution I described).
Comment 18 Eyal Rozenberg 2024-09-19 20:22:39 UTC
(In reply to Tomaz Vajngerl from comment #17)
> (In reply to Eyal Rozenberg from comment #16)
> > We just agreed that PivotCharts, even now, do not reflect the data in a
> > single way. XY-scatter charts reflect it one way, Column charts reflect it
> > another way. Thus, creating by-row rather than by-column data series charts
> > is not a deviation from "the" way; it's just yet another way.
> 
> No, that's the representation of the data that is different.

"Reflection", "representation" - you're splitting hairs. Transposition is literally a reflection. 

> It reflects the
> data in a way that row fields are (main) axis data and column fields are
> each its own data series. That stays the same independent on the type of the
> chart.   

That's the bug. There is no reason to force this being the case. A table can be read as columns or as rows - whether it's a PivotTable or not.


> OOXML interoperability issue between LO and MSO (and other editors that can
> read OOXML and support PivotCharts). To reflect the data in a different way
> would need a LO specific extension to the standard (or a solution to put the
> PivotTable internal to the PivotChart - which brings this back to the first
> possible solution I described).

The fact that MSO or OOXML don't support something, and we add support for it - is not an interoperability issue. If we spreadsheets with the feature set common between both apps, or LO and OOXML, were to have problems going in one direction or the other - that would be an interop issue.

But indeed, if OOXML cannot represent this, such a PivotChart could not be saved to an OOXML (without an LO extension). And now that you raise this question - I suppose we also have to ask whether ODTs will have a problem with this.