Hi
I use jfreechart 1.0.19 with jfreesvg 2.1
Exported svg files from jfreechart (even from jfreechart demo) are wrongly showed being opened by Corel Draw.
Seems like every chart shape has a not fully transparent backgound and if a large amount of them is presented in output - some of them become darked or totally disappear like being masked.
Is there some kind of workaround?
Exported file (jfreechart demo).
Exported file with about 2000 poins.
Svg from jfreechart distorsion.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Svg from jfreechart distorsion.
Sorry for the delay responding. I don't have Corel Draw so it is hard for me to test this. I have seen a similar issue earlier with SVG containing rgba() colors...rgba() is not yet part of the SVG standard, even though the browsers handle it just fine. But this issue was fixed in JFreeSVG 2.0 (now it writes rgb() colors and a separate opacity attribute). But just in case I missed something, could you search through the SVG and see if there are any rgba colours specified?
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: Svg from jfreechart distorsion.
Sorry for long delay too.
No, there are only rgb items.
Can I set layer/figure background clolr to be transparent? Even is there a backgrund property or soething like that in svg. Sorry I'm new to SVG format.
No, there are only rgb items.
Can I set layer/figure background clolr to be transparent? Even is there a backgrund property or soething like that in svg. Sorry I'm new to SVG format.
Re: Svg from jfreechart distorsion.
And yes it looks perfect it browser.
Here is an example file:
https://drive.google.com/file/d/0B_KFbS ... sp=sharing
Here is an example file:
https://drive.google.com/file/d/0B_KFbS ... sp=sharing
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Svg from jfreechart distorsion.
Thanks for the test file. My first step is trying it out in a browser, this gives me a file encoding error until I replace all the thousands separators for the numerical labels on the axes. Are you doing anything special there? After replacing those, the chart renders fine in all the browsers I have. I'll keep digging.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Svg from jfreechart distorsion.
When you write the SVG to file, do you use the SVGUtils class? It creates an OutputStreamWriter with UTF-8 for the encoding:
...but according to the error that I'm seeing in FireFox, your file is not UTF-8 encoded. I'd like to at least rule that out as the cause of the issue.
Code: Select all
OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: Svg from jfreechart distorsion.
This file was generated from context menu of a ChartPanel. "Save as -> SVG..."
Is there any documentation for SVG format that I can use to check.
Is there any documentation for SVG format that I can use to check.