Download it now!
Bug 75316 - FILEOPEN: .xlsx Fails to import chart properly - axis title alignment lost
Summary: FILEOPEN: .xlsx Fails to import chart properly - axis title alignment lost
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Chart (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: Other All
: medium minor
Assignee: Markus Mohrhard
URL:
Whiteboard: target:5.0.0
Keywords:
: 68884 (view as bug list)
Depends on:
Blocks: OOXML-Chart 75054
  Show dependency treegraph
 
Reported: 2014-02-21 11:14 UTC by Luke
Modified: 2019-09-16 13:05 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Chart showing issue with vertical allignment .xlsx import (11.51 KB, application/vnd.ms-excel.12)
2014-02-21 11:14 UTC, Luke
Details
Recreated the title in 2007 (11.55 KB, application/vnd.ms-excel.12)
2014-02-21 12:24 UTC, Luke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke 2014-02-21 11:14:41 UTC
Created attachment 94505 [details]
Chart showing issue with vertical allignment .xlsx import

This bug was tested LibreOffice v4.3 running in windows 7. It appears that LibreOffice loses formatting when importing MS .xlsx files with charts. I have attached an example.

Steps to reproduce the bug:
1. Open Demo-Hayden-Management-v2-chart.xlsx document in calc
2. Open Demo-Hayden-Management-v2-chart.xlsx document in Excel 2007/skydrive
3. Compare the documents. 

Note: The title axis of "USD In Hundred Thousands" is not vertically (270 deg) aligned.
Comment 1 Luke 2014-02-21 12:24:59 UTC
Created attachment 94509 [details]
Recreated the title in 2007

I believe this chart was original created in 2003 or 2010. To try to narrow down the issue, I redid the title in Excel 2007. This file opens correctly in LO Calc. Attached is the updated file. If you unzip it and run a diff of \xl\charts\chart1.xml:

-<c:axId val="74228864"/><c:axId val="74230784"/><c:axId val="0"/></c:bar3DChart><c:catAx><c:axId val="74228864"/>
+<c:axId val="44365312"/><c:axId val="48443776"/><c:axId val="0"/></c:bar3DChart><c:catAx><c:axId val="44365312"/>

- <a:bodyPr/>
+ <a:bodyPr vert="horz" rot="-5400000"/>

- <c:crossAx val="74228864"/>
+ <c:crossAx val="44365312"/>

It appears that either 1) vert="horz" rot="-5400000" is coming from somewhere else in the file, or 2) the text box is being shrunk. Any OOXML gurus know what's going on here?
Comment 2 retired 2014-02-27 12:52:29 UTC
Confirmed:4.2.1.1:OSX as well as latest nightly from today -> NEW

Thanks for the report Luke.
Comment 3 Luke 2014-04-01 07:37:30 UTC
The attachment 85112 [details] from Bug 68884 has the same issue with the axis formatting of the Y title.
Comment 4 Luke 2014-04-01 07:41:48 UTC
*** Bug 68884 has been marked as a duplicate of this bug. ***
Comment 5 Markus Mohrhard 2015-04-20 02:28:18 UTC
I can currently not explain why MSO imports the first file with a vertical axis title.

Creating a new file in MSO 2007/2010/2013 creates a file that contains an explicit rotation value.

If I modify the file manually and remove the attribute MSO still imports it with a vertical axis title whereas we import it with a horizontal one. There seems to be nothing in the spec that mandates either behaviour so I will not change that for now.
Comment 6 Markus Mohrhard 2015-04-25 13:14:03 UTC
(In reply to Markus Mohrhard from comment #5)
> I can currently not explain why MSO imports the first file with a vertical
> axis title.
> 
> Creating a new file in MSO 2007/2010/2013 creates a file that contains an
> explicit rotation value.
> 
> If I modify the file manually and remove the attribute MSO still imports it
> with a vertical axis title whereas we import it with a horizontal one. There
> seems to be nothing in the spec that mandates either behaviour so I will not
> change that for now.

So after reading the spec for a bit longer and thinking about it I think there is one phrase in there that might explain that behaviour.

If there is no rot value specified they assume a value of 0 but only if the parent element has no rotation value set. It is not directly clear what might be the parent element but I assume in this case it should be the Y-axis which is assumed to be rotated by 90 degrees.

I'll still need to think about it a bit more.
Comment 7 Markus Mohrhard 2015-05-08 10:38:21 UTC
I have a fix for the primary axis. I still need to check if the same pattern is necessary for the secondary axis.

I'm also still missing a test case.
Comment 8 Commit Notification 2015-05-08 12:57:53 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=07e3155a666e85b8213608423ae84dbd2b30c3dc

inherit default title rotation from parent, tdf#75316

It will be available in 5.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2015-05-08 12:58:08 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=28ca767e57e00990428b804154bf15b940c63bd1

default text rotation for secondary axis is also from parent, tdf#75316

It will be available in 5.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2015-05-08 12:58:20 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5d69cd2eabb39c9a1be6d641f3bc901c84ea3608

add test for tdf#75316

It will be available in 5.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2015-05-08 12:58:24 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=13ede60a9604564339647cff6193d9343ea2fd48

also add test for secondary axis, related tdf#75316

It will be available in 5.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 12 Luke 2015-05-09 03:17:37 UTC
Verified fixed in 
Version: 5.0.0.0.alpha1+
Build ID: 3842967e5276aabdf28e8eb047803389a41793c7

Great detective work Markus. The chart import/export code is really starting to shine thanks to all your recent fixes.