|
SVG output and Inkscape |
Posted by Alex on Jan-25-2011 23:19 |
|
I created a SVG chart with CD. I then tried loading the SVG into Inkscape to make some modifications to it. The CDML in the title appears to be distorted in Inkscape. Also when I converted the SVG to a PNG using Inkscape, a red dot and "Hits Per 15 Minutes" appeared in the upper left corner.
Are the SVG graphics CD creates not compatible with Inkscape or am I doing something wrong?
|
Re: SVG output and Inkscape |
Posted by Peter Kwan on Jan-26-2011 00:53 |
|
Hi Alex,
If you view the SVG using FireFox, is the chart correct?
As far as I know, there is currently no SVG viewer or editor that support the full SVG. Every SVG viewer or editor has a lot of issues and supports only a subset of SVG. ChartDirector is specially designed so that its SVG output works around all the issues of the browsers. As it is impractical for us to work around all limitations or bugs in all SVG viewers or editors, it is possible that other SVG viewers or editors may not be able to view the charts correctly.
For Inkscape, currently we are aware of at least 1 issue related to fonts. ChartDirector specifies the fonts as "style='font:bold 16px Arial;'". Inkscape does not support this format, but must use "style='font-weight:bold;font-size:16px;font-family:Arial;'". According to the SVG standard, both formats are correct. So it means Inkscape only supports a subset of the standard, and ChartDirector happens to be using the subset that Inkscape does not support. (The browsers support both formats.) It may explain why the title text is not as expected.
I am not sure what may cause the red dot and the text on the top left corner.
For your case, you may consider the followings:
(a) Write code to modify the font specification "font:bold 16px Arial;" output to ChartDirector to a format that is supported by Inkscape.
(b) If you are using Inkscape for modifications interactively, you may manually modify the image for the parts that Inkscape does not handle correct.
(c) If you like, you may try to trouble-shoot the issue to see why there is a red dot and text on the top left corner. If this is due to ChartDirector outputs invalid SVG, please let me know. (However, if the FireFox can render the chart correctly, then I think this is unlikely the case.) If this is due to Inkscape handling the SVG incorrectly, you may consider to write code to modify the SVG to work around.
Hope this can help.
Regards
Peter Kwan |
Re: SVG output and Inkscape |
Posted by Alex on Jan-26-2011 01:34 |
|
Hey Peter,
The SVG CD creates does display fine in Firefox. As for the font issue you mentioned, I just realized the Y-axis label was also bigger and bolded in CD, but Inkscape seems to ignore that. However, here is the how the title is created with CDML and you can see how Inkscape interprets that title in the first post.
$title = "<*color=3399ff*>S<*color=000000*>essions + <*color=EE0000*>A<*color=000000*>lerts";
I guess I'll go with your second suggestion for now and hope CD and Inkscape end up cooperating better in the future. Thanks for your help! |
|