Download it now!
Bug 78232 - Embedding PyGal SVG gives black box, but inkscape has no trouble
Summary: Embedding PyGal SVG gives black box, but inkscape has no trouble
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected) rc
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: SVG-Import
  Show dependency treegraph
Reported: 2014-05-03 21:30 UTC by tim-libreoffice
Modified: 2019-09-20 11:21 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:

PyGal generated chart, SVG test file (20.89 KB, image/svg)
2014-05-03 21:30 UTC, tim-libreoffice
Inkscape converted to "Plain SVG" (22.15 KB, image/svg+xml)
2014-05-03 21:30 UTC, tim-libreoffice
Both files inserted into a document (PyGal's first, InkScape's second) (37.78 KB, image/png)
2014-05-03 21:31 UTC, tim-libreoffice

Note You need to log in before you can comment on or make changes to this bug.
Description tim-libreoffice 2014-05-03 21:30:04 UTC
Created attachment 98387 [details]
PyGal generated chart, SVG test file

I'm generating charts using the PyGal library which can be found here:

I like the ability to build scalable images that can work in both LibreOffice and the web.  Unfortunately, LibreOffice is failing to display the charts I generate.  

When I insert a PyGal generated SVG image (in either calc or write), I get just a black box.  If I instead open the SVG in inkscape, the chart looks fine.  From inkscape I can then save the image as "Plain SVG" in a second file, and then LibreOffice can handle the output of that.

I'm attaching 3 files:
- A PyGal generated SVG
- The Inkscape converted version of the SVG
- A screenshot of what both versions of the SVG look like in calc file

I have compared the SVG source of the two files a bit to see what is different.  The PyGal one has some JavaScript, but stripping this out has no effect on the display in either program.  One big difference is that the PyGal SVG seems to define most styles in a <style> tag and then applies those via classes to the XML file's elements.  The Inkscape "Plain SVG" version seems to have copied all of those style specifications down to each element individually.  So perhaps there are bugs in LibreOffice's interpretation of styles.

Note that I have tested for this issue in several recent versions of LibreOffice.  It exists in all.
Comment 1 tim-libreoffice 2014-05-03 21:30:57 UTC
Created attachment 98388 [details]
Inkscape converted to "Plain SVG"
Comment 2 tim-libreoffice 2014-05-03 21:31:46 UTC
Created attachment 98389 [details]
Both files inserted into a document (PyGal's first, InkScape's second)
Comment 3 steve -_- 2014-10-28 00:52:28 UTC
Download SVG test file. Insert SVG into writer > black box.

Confirmed -> NEW with LO on OSX 10.10, thus OS -> ALL.
Comment 4 Xisco Faulí 2015-11-16 15:54:47 UTC
The problem is that SVG filter doesn't support styles defined inside <style type="text/css">

*** This bug has been marked as a duplicate of bug 94765 ***
Comment 5 Xisco Faulí 2019-09-19 08:39:57 UTC
Not a dupe of bug 94765