Chart > to svg with SVGGenerator > to Image via Batik > itext.
However, I have some special characters in the StackLabels/Chart caption (eg €, -,…) which are not displayed correctly in the resulting pdf. Where can I set the correct encoding?
thanks fo the input! I suspect the problem is not iText but the SVGGenerator? I only have problems with certain special characters in the chart. For example, if the chart title contains
\u20AC € @&%
the resulting String from
String svg = SVGGenerator.getInstance().generate(conf)
is
� � @&%.
I have the same problem when generating svg from Chart using SVGGenerator. All German Umlaute like ü, ä or ö are converted to the same 3 bytes 0xEF, 0xBF, 0xBD which are displayed as �. This seems to be a general problem of the SVGGenerator.
I used Charts 2.0. After updating to Charts 3.0 the problem was fixed. But then rotated labels on the x-axis where NOT rotated in the chart but in the exported pdf. This seems to be a bug in 3.0. I then changed to Charts 2.1.3 and now everything is working fine.