Bug 133376 - EDITING Pie chart labels “Best fit” placement overlaps other chart slices
Summary: EDITING Pie chart labels “Best fit” placement overlaps other chart slices
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Balázs Varga
URL:
Whiteboard: target:7.1.0 target:7.0.0.1
Keywords:
Depends on:
Blocks: Chart
  Show dependency treegraph
 
Reported: 2020-05-25 14:40 UTC by NISZ LibreOffice Team
Modified: 2020-11-26 10:00 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Excel (12.21 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2020-05-25 14:40 UTC, NISZ LibreOffice Team
Details
Screenshot of the original document side by side in Excel and Calc (118.27 KB, image/png)
2020-05-25 14:40 UTC, NISZ LibreOffice Team
Details
this is a screenshot from 7.1 (103.70 KB, image/png)
2020-06-06 16:34 UTC, BogdanB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2020-05-25 14:40:18 UTC
Created attachment 161264 [details]
Example file from Excel

When a pie chart has long data labels that are set to “Best fit” placement, they are not aligned to the pie chart slice sizes, but to each other, resulting in labels flowing through to other slices. 
This is both hard to read and misleading. Attachment is from Excel, but the problem is not file format specific, just illustrates a better solution.

Steps to reproduce:
    1. Open attached document.

Actual results:
The gray chart slices text overflows into the orange slice.

Expected results:
The gray chart slices label is outside the chart, if it cannot be fitted into the area of the slice.

LibreOffice details:
Version: 7.0.0.0.alpha1+ (x64)
Build ID: b3c8859cd20bd02adea5d2b026001f67feacc754
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL
Comment 1 NISZ LibreOffice Team 2020-05-25 14:40:35 UTC
Created attachment 161265 [details]
Screenshot of the original document side by side in Excel and Calc
Comment 2 BogdanB 2020-05-25 15:57:15 UTC
Confirm it.
Version: 6.4.4.2
Build ID: 3d775be2011f3886db32dfd395a6a6d1ca2630ff
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded
Comment 3 Commit Notification 2020-06-02 12:09:16 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/73477348e30c6931a537cba5557c250183fbeb9b

tdf#133376 Chart view: improve BestFit position of data labels

It will be available in 7.1.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 4 Commit Notification 2020-06-02 19:35:03 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/263c3b56fc36cd9435b57bfde8ff9b38a7d894b7

tdf#133376 Chart view: improve BestFit position of data labels

It will be available in 7.0.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.
Comment 5 BogdanB 2020-06-06 16:34:30 UTC
Created attachment 161688 [details]
this is a screenshot from 7.1

It's not the same like in Excel, but at least is much better center.
See screenshot.
Comment 6 Buovjaga 2020-11-26 08:14:25 UTC
The test added with the fix is unreliable. It fails, if using font scaling on Windows.

Similar situations have been fixed like this:
https://gerrit.libreoffice.org/c/core/+/85967
https://gerrit.libreoffice.org/c/core/+/85974
https://gerrit.libreoffice.org/c/core/+/75302
https://gerrit.libreoffice.org/c/core/+/65595

A "brute force" fix example (skipping the test):
https://gerrit.libreoffice.org/c/core/+/65595
Comment 7 Buovjaga 2020-11-26 10:00:44 UTC
Relevant patch by Mike K.: https://gerrit.libreoffice.org/c/core/+/106661
Introduce BootstrapFixture::IsDefaultDPI convenience function