Bug 114163 - Stacked and percent stacked chart legends have reversed order
Summary: Stacked and percent stacked chart legends have reversed order
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.3.0 target:6.2.0.1
Keywords:
Depends on:
Blocks: Chart-Legends
  Show dependency treegraph
 
Reported: 2017-11-30 08:48 UTC by Gabor Kelemen (allotropia)
Modified: 2020-06-23 07:28 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file made with Excel 2013 (21.09 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2017-11-30 08:48 UTC, Gabor Kelemen (allotropia)
Details
The example file saved by Calc 6.1 (12.12 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-09-14 08:16 UTC, Gabor Kelemen (allotropia)
Details
LibreOffice vs MS Office legend comparison (63.32 KB, image/png)
2018-09-20 01:08 UTC, Bartosz
Details
Video from review https://gerrit.libreoffice.org/#/c/64632/ (3.39 MB, video/ogg)
2018-12-06 10:55 UTC, Bartosz
Details
Video from review: https://gerrit.libreoffice.org/#/c/64632/ (17.73 MB, video/ogg)
2018-12-06 12:22 UTC, Balázs Varga
Details
Screenshot of the original file in LO61 LO_Master and MSO (166.69 KB, image/png)
2018-12-06 12:55 UTC, Balázs Varga
Details
Expected results in case of BAR/COLUMN chart (77.05 KB, image/png)
2018-12-07 08:33 UTC, Balázs Varga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2017-11-30 08:48:08 UTC Comment hidden (obsolete)
Comment 1 Jacques Guilleron 2017-11-30 10:13:25 UTC
Hi Gabor,

Reproduced with
LO 6.0.0.0.beta1 Build ID: 97471ab4eb4db4c487195658631696bb3238656c
Threads CPU : 2; OS : Windows 6.1; UI Render : par défaut; 
Locale : en-US (fr_FR); Calc: CL
Comment 2 Bartosz 2018-01-12 23:58:04 UTC Comment hidden (obsolete)
Comment 3 Aron Budea 2018-05-14 22:47:03 UTC
Possibly related to bug 53301?
Comment 4 Gabor Kelemen (allotropia) 2018-09-14 08:16:11 UTC Comment hidden (obsolete)
Comment 5 Bartosz 2018-09-20 01:08:50 UTC Comment hidden (obsolete)
Comment 6 Bartosz 2018-11-28 20:15:02 UTC
After deep anaylysis it seems that this is generic issue with LibreOffice Charts, not related to XLSX import.

Steps to reproduce:
1. Open LibreOffice
2. Create some data with axis labels
3. Select data range
4. Click "Insert -> Chart"
5. Switch for different chart types (eg. Column, Bar...), and variants (eg. Normal, Stacked, Percent Stacked) , and observe the legend order.



Actual results:
Stacked Bar, Percent Stacked Bar, Stacked Column, Percent Stacked Column, Stacked Area, Percent Stacked Area, Points and Lines chart legends reversed.

Expected results:
Stacked Bar, Percent Stacked Bar, Stacked Column, Percent Stacked Column, Stacked Area, Percent Stacked Area, Points and Lines chart legends NOT reversed.
Comment 7 Balázs Varga 2018-11-28 20:48:02 UTC
This is the code pointer:
https://opengrok.libreoffice.org/xref/core/chart2/source/view/charttypes/VSeriesPlotter.cxx#2223

And I think we should respect the direction of axis: But unfortunately we did not know the axis on this level.
https://opengrok.libreoffice.org/xref/core/chart2/source/view/charttypes/VSeriesPlotter.cxx#2225

Or the chart types, for example the legends should reversed in case of BAR charts.
But unfortunately, on this level there is no difference between  CHART2_SERVICE_NAME_CHARTTYPE_BAR and CHART2_SERVICE_NAME_CHARTTYPE_COLUMN chart types. But if we know the axis on this level we could use the isSwapXAndY() for handling this.
Comment 8 Balázs Varga 2018-11-28 21:10:09 UTC
So I think first we should remove this:
https://opengrok.libreoffice.org/xref/core/chart2/source/view/charttypes/VSeriesPlotter.cxx#2223
The second step is to handle the charttypes (BAR/COLUMN) legend direction. (that would be more options).
And the third would be a hard codeing for respect the axis directions.
What do you think about this Bartosz?
Comment 9 Bartosz 2018-12-06 10:55:17 UTC
Created attachment 147322 [details]
Video from review https://gerrit.libreoffice.org/#/c/64632/

Unfrotunately I cannot find much difference with the patch.
See attached video.
Comment 10 Balázs Varga 2018-12-06 12:22:51 UTC
Created attachment 147323 [details]
Video from review: https://gerrit.libreoffice.org/#/c/64632/

Thank you for the review and the video. But I am a little confused. I tested the problem with the patch and it worked for me even if I did the same way just like you in the video.
Comment 11 Balázs Varga 2018-12-06 12:55:46 UTC
Created attachment 147325 [details]
Screenshot of the original file in LO61 LO_Master and MSO

Screenshot of the original file in LO61 LO_Master (with the patch) and MSO.
May I ask that how did you exactly the file in the video or can you send me the file?
Comment 12 Balázs Varga 2018-12-07 08:33:08 UTC
Created attachment 147341 [details]
Expected results in case of BAR/COLUMN chart

Expected results in case of BAR/COLUMN chart legend orientation: Screenshot from MSExcel 2016
Comment 13 Commit Notification 2018-12-07 12:40:50 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/40144617ce05d7eff86eeb8a412c6991fe0b819e%5E%21

tdf#114163 Chart: fix order of legend names

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2018-12-11 08:44:41 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/ee2434656f24ccb31246b1347d46b72710faf076%5E%21

tdf#114163 Chart: fix order of legend names

It will be available in 6.2.0.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.