Bug 159914 - Chart anchor inconsistent in ODS to XLSX and XLS
Summary: Chart anchor inconsistent in ODS to XLSX and XLS
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:xlsx
Depends on:
Blocks:
 
Reported: 2024-02-26 21:10 UTC by Allan Dominguez
Modified: 2024-04-24 15:41 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Allan Dominguez 2024-02-26 21:10:17 UTC
Spreadsheets containing anchored charts are not consistently converted between file formats. When creating a chart anchored as "To Cell (resize with cell)" in an .ods format, when saving as a new .xlsx formatted file, the charts anchor converts to "To Cell". 

To replicate this:
1. Create an new .ods with a simple chart/graph created in it
2. Right click the chart and select Anchor > To Cell (resize with cell)
3. Now save the file (as .ods)
4. Close the file
5. Open this saved .ods file
6. Now Save As an .xlsx format
7. Once again, close the file - it is important that we close the file here as the property is seemingly unchanged if not closed and reopened
8. Open the newly saved .xlsx file
9. Right click the chart and open the Anchor sub-menu
10. The property here will have changed to "To Cell"

Understandably, it is highlighted when changing the file format that the formatting may be lost in the new .xlsx file format, but I've noticed that the conversion from .ods to .xlsx does not align with conversion from .ods to .xls, which is causing issues to the expected behaviour as we have recently deprecated .xls.

Therefore, ideally the chart conversion can either:
- align the same anchor between file formats, i.e "To Cell (resize with cell)" anchor in .ods converts to the same anchor in .xlsx - this behaviour has proven to work with images
- conversion to .xlsx should follow the behaviour of .xls, i.e. "To Cell (resize with cell)" anchor in .ods converts to "To Page" in .xlsx/.xls, for whatever reason
Comment 1 Buovjaga 2024-04-24 15:41:12 UTC
Based on this: https://www.tutorialspoint.com/how-to-prevent-resizing-charts-when-resizing-rows-and-columns-in-excel
it is possible to set "Move and size with cells" property to charts in Excel, so it should be supported.

I confirm that it is retained for images.

Arch Linux 64-bit
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9ad0eb9a62b572b15ae0bfd31674aedd77eb4761
CPU threads: 8; OS: Linux 6.8; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 24 April 2024