Bug 156435 - FILEOPEN PPTX: chart labels fail to line break (and are rendered at an angle instead)
Summary: FILEOPEN PPTX: chart labels fail to line break (and are rendered at an angle ...
Status: REOPENED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
6.4.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: OOXML-Chart Chart-Labels 142328
  Show dependency treegraph
 
Reported: 2023-07-24 06:13 UTC by Gerald Pfeifer
Modified: 2023-08-30 10:59 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample slide (PPTX) (1.15 MB, application/vnd.ms-powerpoint)
2023-07-24 06:13 UTC, Gerald Pfeifer
Details
Visual comparison Office 365 (left) vs LibreOffice (right) (186.50 KB, image/png)
2023-07-24 06:14 UTC, Gerald Pfeifer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer 2023-07-24 06:13:40 UTC
Created attachment 188527 [details]
Sample slide (PPTX)

Compare the screenshots of the attached document in PowerPoint (online)
vs Impress and notice how in the former the chart labels 1..., 2..., etc.
nicely line break and fit the available space where in LibreOffice it's
one line of text at an angle - that does not fit at all.

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 77fca616e0bd79e0b405fd0b3543cf8e94e15df3
CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Gerald Pfeifer 2023-07-24 06:14:04 UTC
Created attachment 188528 [details]
Visual comparison Office 365 (left) vs LibreOffice (right)
Comment 2 Gerald Pfeifer 2023-07-24 06:16:21 UTC
Already looks like that in 

Version: 6.4.8.0.0+
Build ID: 99b065ec31d032fc08ab14f66430dac4fef904a5
CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:libreoffice-6-4, Time: 2020-10-08_08:57:08
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Comment 3 Gabor Kelemen (allotropia) 2023-07-24 11:40:07 UTC
Yup. Hello text length based automatic rotation, my old nightmare.

*** This bug has been marked as a duplicate of bug 142328 ***
Comment 4 Stéphane Guillou (stragu) 2023-07-24 12:11:25 UTC
Gabor, I think we are looking at something different here, but correct me if I'm wrong.

In 6.3, labels were not rotated but not wrapped.
In 6.4.7.2, They are rotated.

Also reproduced the issue as described in:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 46d7119b8be03968017e59d882e5671350304e15
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

But coincidentally, looks good in:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 94caaf5c9e2917a3202cf515d61eaa9399b2c2b5
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

(whereas bug 142328 is still not fixed, still looks like attachment 172790 [details])

So it must have been fixed by something in those recent commits:

https://git.libreoffice.org/core/+log/46d7119b8be03968017e59d882e5671350304e15..94caaf5c9e2917a3202cf515d61eaa9399b2c2b5/?s=142082d216cf48bc905c2468809bcc074fe2c638

Marking as "works for me" until a fix can be identified.
Gabor, any insights on what XML element we are looking for in bug 142328?
Comment 5 Stéphane Guillou (stragu) 2023-07-24 12:12:55 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> https://git.libreoffice.org/core/+log/
> 46d7119b8be03968017e59d882e5671350304e15..
> 94caaf5c9e2917a3202cf515d61eaa9399b2c2b5/
> ?s=142082d216cf48bc905c2468809bcc074fe2c638

... actually, make that https://git.libreoffice.org/core/+log/46d7119b8be03968017e59d882e5671350304e15..94caaf5c9e2917a3202cf515d61eaa9399b2c2b5
Comment 6 Gabor Kelemen (allotropia) 2023-07-24 16:31:49 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> Marking as "works for me" until a fix can be identified.
> Gabor, any insights on what XML element we are looking for in bug 142328?

Sure, we are looking into a missing feature here. It's an MSO behavior with charts, demonstrated there by the same chart/dataset in the same file, but with different chart area widths. 
This file also shows it, if you play with it in PP.

If you have some long data label and horizontal rotation is set, but no exact rotation value set (which is true in this example file, hence duplicate), then MSO measures the text length and according to the chart width, decides how does it fit best: for wide charts it shows the labels horizontally like the UI suggests. 
If there is less space available, it will rotate to 45 degrees, and if there is very little space it will rotate to 90 degrees left.
It does this in editing mode as well, if you make the chart area wider/narrower.

What you may see (I see the 45 degrees rotation on 2 days old builds instead of 0) may be accidental improvement in this particular file, but I doubt the proper text measuring/online resizing feature got implemented overnight.
Comment 7 Gerald Pfeifer 2023-08-21 17:42:20 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> But coincidentally, looks good in:
> 
> Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
> Build ID: 94caaf5c9e2917a3202cf515d61eaa9399b2c2b5
> CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
> Locale: en-AU (en_AU.UTF-8); UI: en-US

Now, with

   Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
   Build ID: e60ef8651cfb30335471d1622e58c13eebc7d58b
   CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: gtk3
   Locale: en-US (en_US.UTF-8); UI: en-US

it looks like when I reported the issue, that is, Attachment #188528 [details].

Instead of line wrapping the labels, LibreOffice renders them at a 
45° angle running into the list of labels below.

 
> (whereas bug 142328 is still not fixed, still looks like attachment 172790 [details]
> [details])

In terms of its title bug #142328 indeed looks like it covers this.
Alas the example there does not have a case where labels are to be
wrapped. 

Should we keep this one separately, making it a dependency of the other one?
Comment 8 Gerald Pfeifer 2023-08-21 17:43:19 UTC
Comment #7 was tested with

  Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
  Build ID: e60ef8651cfb30335471d1622e58c13eebc7d58b
  CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: gtk3
  Locale: en-US (en_US.UTF-8); UI: en-US
Comment 9 Stéphane Guillou (stragu) 2023-08-30 10:59:00 UTC
(In reply to Gerald Pfeifer from comment #7)
> Now, with
> 
>    Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
>    Build ID: e60ef8651cfb30335471d1622e58c13eebc7d58b
>    CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: gtk3
>    Locale: en-US (en_US.UTF-8); UI: en-US
> 
> it looks like when I reported the issue, that is, Attachment #188528 [details]
> Instead of line wrapping the labels, LibreOffice renders them at a 
> 45° angle running into the list of labels below.

I see the labels horizontal and wrapped as a side-effect of:

commit 4b743de97fc133623e46827869c4ea3eb845ad47
author	Khaled Hosny  Mon Jul 17 12:38:41 2023 +0300
committer	خالد حسني  	Sun Jul 23 06:01:56 2023 +0200
tdf#156234: Don’t round glyph coordinates when doing subpixel positioning

But if I add some characters to a label, or increase the font size, or reduce the chart width, it goes back to single line on a 45° rotation.

On Office.com, reducing the chart width will have the same effect: 45° rotation, and eventually vertical labels. LO does not get to vertical labels and instead displays every other one.

So I guess the issue is that we have a different threshold than MSO between wrapped and rotated, and that we don't have the vertical label mode implemented? Which is what Gabor was explaining?