JFreeSVG 1.2

A discussion forum for JFreeSVG (a fast, lightweight, SVG generator for the Java platform).
Locked
david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

JFreeSVG 1.2

Post by david.gilbert » Fri Sep 13, 2013 12:37 pm

A new version of JFreeSVG is now available for download. From the README file:

Code: Select all

Version 1.2 (13 September 2013)
- added SVG and XLINK namespaces to SVG element;
- fixed capitalisation of linearGradient element, to pass W3C validator;
- added support for Java2D's RadialGradientPaint;
- added SVGUtils.writeToSVG() method; 
- added new demo SVGTimeSeriesChartDemo1.java.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

henriklasu
Posts: 3
Joined: Fri Sep 06, 2013 11:20 am
antibot: No, of course not.

Re: JFreeSVG 1.2

Post by henriklasu » Mon Sep 23, 2013 12:04 pm

Hi

I try to save to draw a chart on Ubuntu 12-04 64 bit and get an error:

Exception in thread "Thread-26" java.lang.UnsupportedOperationException: Not supported yet.
at org.jfree.graphics2d.svg.SVGGraphics2D.getDeviceConfiguration(SVGGraphics2D.java:369)
at org.jfree.chart.plot.XYPlot.draw(XYPlot.java:3111)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1471)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1365)

My code looks like this:

public void save(File file, JFreeChart chart, int width, int height) throws IOException {
SVGGraphics2D g2 = new SVGGraphics2D(width, height);
chart.draw(g2, new Rectangle(0, 0, width, height), createChartRenderingInfo(width, height));
String svgDocument = g2.getSVGDocument();
...

it works fine on Windows 7 e.t.c.

The same happens when i try to create a PDF on Ubuntu 12-04 64 bit (with orsonPDF)

Exception in thread "Thread-31" java.lang.UnsupportedOperationException: Not supported yet.
at com.orsonpdf.PDFGraphics2D.getDeviceConfiguration(PDFGraphics2D.java:779)
at org.jfree.chart.plot.XYPlot.draw(XYPlot.java:3111)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1471)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1353)

My code:

public void save(File file, JFreeChart chart, int width, int height) throws IOException {
PDFDocument pdfDoc = new PDFDocument();
Page page = pdfDoc.createPage(new Rectangle(0, 0, width, height));
PDFGraphics2D g2 = page.getGraphics2D();
chart.draw(g2, new Rectangle(0, 0, width, height));
pdfDoc.writeToFile(file);

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: JFreeSVG 1.2

Post by david.gilbert » Mon Sep 23, 2013 2:20 pm

Thanks for the feedback. I'll dust off my old Ubuntu installation and see if I can reproduce this, then figure out the best way to implement this getDeviceConfiguration() method.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: JFreeSVG 1.2

Post by david.gilbert » Tue Sep 24, 2013 7:37 pm

I was not able to reproduce this locally, but I've implemented the getDeviceConfiguration() method and released JFreeSVG 1.3 (which also includes some other bug fixes). Hopefully this version works for you, but let me know if there are still issues.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked