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);