ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  SVG Multichart Output
Posted by Brant on Nov-10-2011 07:47
I'm trying to combine two simple XY charts into one MultiChart and save as an svg file.
When I add a Y axis label to the charts and open the svg file in Inkscape (so I can export a
vector PDF) the axis text is bold across the entire graph. If I remove the Y axis label or if I
export the graphs individually as an svg everything works fine. Is this a bug in the svg
multichart output?

  Re: SVG Multichart Output
Posted by Peter Kwan on Nov-10-2011 22:36
Hi Brant,

Please try to view the SVG using FireFox or using IE (using the Adobe SVG Viewer plug-in for IE if necessary). If the SVG chart appears normal in FireFox and IE, but appears differertly in Inkscape, from our experience, it is most likely due to bugs in Inkscape.

If the SVG chart does not appear correctly even in FireFox and IE, is it possible to attach the SVG of the MultiChart, and also the SVG of the individual XYCharts, so I can analyse them to diagnose the error. If you cannot include the charts in a public forum, you may email me pkwan@advsofteng.net

From our general experience, FireFox and IE are designed to view SVG, and they are more reliable for displaying the SVG correct. Many graphics editors (including Inkscape) are designed for creating SVG and supports only a subset of SVG. They can reliably load simple SVG created by themselves, but may not reliably load complex SVG created by third party programs (such as those created by ChartDirector, which can be very complex and contains so many elements that it is unlikely a human can draw it manually).

For Inkscape in particular, we are aware there is at least 1 issue related to fonts. If the font is specified as "style='font:bold 16px Arial;'" (which is used by ChartDirector and is perfectly valid as according to the SVG stardard), Inkscape may get confused. If a SVG image is generated by Inkscape, it will use the format "style='font-weight:bold;font-size:16px;font-family:Arial;'" (which is also perfectly valid according to the SVG standard), and of course Inkscape will load its own format correctly.

You can determine if the above is the cause of the problem by manually editing the SVG using a text editor, and replacing the ChartDirector font style to the font style recognized by SVG. If this works, you may write a short program to automatically translate one font style to another font style to satisfy Inkscape. (If your programming system supports regular expression, I think it should only need a few lines of code.)

Hope this can help.

Regards
Peter Kwan

  Re: SVG Multichart Output
Posted by Brant on Nov-11-2011 09:13
Attachments:
Thanks for your reply. I've attached two images, one from Firefox and a second from
Google Chrome. What I see in Inkscape is the same as Chrome with the Y-Axis being
written over the chart, this only happens with Multichart. My problem is finding a good
way to convert an SVG to PDF so I can include a vector based graphic to a more universal
format.
Screen Shot 2011-11-10 at 8.06.49 PM.png
Screen Shot 2011-11-10 at 8.06.59 PM.png

  Re: SVG Multichart Output
Posted by Brant on Nov-11-2011 09:17
Attachments:
I've included the svg file.
dist.svg
dist.svg

14.19 Kb

  Re: SVG Multichart Output
Posted by Peter Kwan on Nov-12-2011 01:56
Attachments:
Hi Brant,

Thanks for the sample SVG. We are able to reproduce the same problem with your SVG. After further analysis, we suspect it is due to a bug in Google Chrome (which is probably using the same SVG implementation as Inkscape, and so behave similarly). It is because we manage to reproduce the problem using a very simple SVG made by hand, of which the only visible element is the text "Y1". The text is rendered twice by Google Chrome, but only once by FireFox. Based on our understanding of SVG, it should be rendered only once. (I have attached our hand made SVG for your reference.)

The key to trigger the error seems to be using "nested symbols" in SVG. That's why it occurs only with a MultiChart, because the SVG output will contain nested symbols in this case.

We will need some more time to analyse this issue in detail. We may file a bug report to Google. In the mean time, we will try to see if there is any method to work around this issue.

Regards
Peter Kwan
test.svg
test.svg

539 bytes

  Re: SVG Multichart Output
Posted by Peter Kwan on Nov-12-2011 02:27
Hi Brant,

For your information, in our testing, we have also tried to use an online SVG to PDF converter, and it does not have the problem as Inkscape or Google Chrome:

http://www.fileformat.info/convert/image/svg2pdf.htm

According to the informaton on the above web page, their SVG to PDF converter is based on Apache Batik and iText.

Regards
Peter Kwan