Bug 65788 - problems with .svg exported from Calc charts
Summary: problems with .svg exported from Calc charts
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Drawing (show other bugs)
Version: 4.0.3.3 release
Hardware: x86-64 (AMD64) All
: medium major
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-15 13:46 UTC by fdes
Modified: 2014-09-07 15:38 UTC (History)
6 users (show)

See Also:
i915 platform:
i915 features:


Attachments
a sample zipped file with ods, odg and svg (34.01 KB, application/zip)
2013-06-15 13:46 UTC, fdes
Details

Description fdes 2013-06-15 13:46:46 UTC
Created attachment 80869 [details]
a sample zipped file with ods, odg and svg

when I export as svg a chart which has been pasted from Calc the resulting svg has two major problems:

1) if I open it with Inkscape the title of the Y axis loses its orientation, but this could be an Inkscape bug

2) if I open it with LibreOffice Draw the result is really weird

I have attached a zip file with 4 files: a calc sheet with a chart (01.ods), the pasted chart as odg (02.odg), the exported svg (03.svg) and finally the odg produced by opening the svg again with LibreOffice Draw (04.odg)
Comment 1 Thomas van der Meulen 2013-06-20 15:53:07 UTC
Thank you for your bug report, I can reproduce this bug running LibreOffice Version: 4.1.0.1
Build ID: 1b3956717a60d6ac35b133d7b0a0f5eb55e9155 on Mac osx 10.8.4. 

the y-axis is also lost wen I open it with Safari.
Comment 2 Dennis Roczek 2013-11-17 11:04:07 UTC
SVG and PNG exported with 4.1.3.2

https://wiki.documentfoundation.org/images/b/ba/Coverity_scan_analysis_results_bar.svg

and

https://wiki.documentfoundation.org/images/3/31/Coverity_scan_analysis_results_bar.png

As you can see (also not in the source code) the description of the bars aren't included.

Moreover stylesheets should be used as many code is multiple times included.

Example ODS can be found here https://wiki.documentfoundation.org/File:Coverity_scan_analysis_results.ods
Comment 3 Dennis Roczek 2013-11-17 11:38:42 UTC
OK: the source code solution for the axis was found:

original (in my coverity example)

 <text class="TextShape"><tspan class="TextParagraph" font-family="Arial" font-size="318px" font-weight="400" transform="translate(1330,10312) rotate(-90) translate(-1330,-10312)"><tspan class="TextPosition" x="1330" y="10312"><tspan fill="rgb(0,0,0)" stroke="none"># of &quot;outstanding defects&quot;</tspan></tspan></tspan></text>

and the solution
 <text class="TextShape" transform="translate(1330,10312) rotate(-90) translate(-1330,-10312)"><tspan class="TextParagraph" font-family="Arial" font-size="318px" font-weight="400"><tspan class="TextPosition" x="1330" y="10312"><tspan fill="rgb(0,0,0)" stroke="none"># of &quot;outstanding defects&quot;</tspan></tspan></tspan></text>

the problem is that the code is "correct", but sadly the translate and rotate is "added" in the wrong object (tspan instead of text)

This is actually an EasyHack now (at least that part)
Comment 4 Dennis Roczek 2013-11-17 14:31:40 UTC
@Tomaz Vajngerl I put you as assigned, please correct if wrong; I saw your contributions at bug #60137 

I believe the problem is in line 1425
http://cgit.freedesktop.org/libreoffice/core/tree/filter/source/svg/svgwriter.cxx?id=9bc0ca091b7037f7c8f4782103a81b7287bc1de3#n1425

or better saying in line 1374 as this is the function opening the tspan element.
http://cgit.freedesktop.org/libreoffice/core/tree/filter/source/svg/svgwriter.cxx?id=9bc0ca091b7037f7c8f4782103a81b7287bc1de3#n1374


So I hope that codepointers help everybody. ;-)
Comment 5 Tomaz Vajngerl 2013-11-17 21:55:56 UTC
Hi,

Actually I never worked on SVG export - only on the export functionality (which is independent of the actual export format) so I don't know if I am the right man for this job. 

Regards, Tomaž
Comment 6 Anonymous Helper 2014-04-28 09:22:42 UTC
For now it seems that putting the transform element into the right object per hand does the job.
Unfortunately nobody seems to be working on this.

thb, you said in bug 57215 you had currently no bandwidth to fix it properly, but it seems there are not so many people able to fix it at all. Just as a reminder, if you have some more bandwidth :)
Thanks so far everyone.
Comment 7 Owen Genat 2014-07-20 11:03:27 UTC
(In reply to comment #0)
> 2) if I open it with LibreOffice Draw the result is really weird

Just for clarity, the black background of the exported SVG (when again opened in Draw) is reported separately in bug 48632.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.