Hi,
I have seen (in the Google) that somebody already opened a Topic for sun.dc.pr.PRException: endPath: bad path, but I couldn't find that.
So once agian sun.dc.pr.PRException: endPath: bad path. When I'm using the JFreeChart, XYBarRenderer on SUN, I get a sun.dc.pr.PRException: endPath: bad path exception when the rendrer draws the Bar ( Graphics2D.draw() or fill() ), even if I altered the code, to check if the Bar intersects with the DataArea ( with Shape.intersects(shape) ).
Does anyone know any solution for this?
Thanks,
Adam
sun.dc.pr.PRException: endPath: bad path
Hello,
Here it is: (link to precedent opic)
http://www.jfree.org/phpBB2/viewtopic.php?t=8599
Here is too: (an other link)
http://www.jfree.org/phpBB2/viewtopic.php?t=6430
Bye;
Mimil
Here it is: (link to precedent opic)
http://www.jfree.org/phpBB2/viewtopic.php?t=8599
Here is too: (an other link)
http://www.jfree.org/phpBB2/viewtopic.php?t=6430
Bye;
Mimil
Sun thinks it's related to this (rather bad) bug:
http://developer.java.sun.com/developer ... 55500.html
http://developer.java.sun.com/developer ... 55500.html
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
You can trigger this exception by drawing shapes with "large" coordinates:
http://bugs.sun.com/bugdatabase/view_bu ... id=4696289
We could add our own clipping code to JFreeChart, but I haven't put much time into investigating that option.
http://bugs.sun.com/bugdatabase/view_bu ... id=4696289
We could add our own clipping code to JFreeChart, but I haven't put much time into investigating that option.
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
PRException, bad path
I run into this error when I am attempting to plot a line with fairly large data values, only when all the data values are *exactly the same*.
For farily large values, it seems it takes about 8 or 9 digits to trigger the problem. As soon as I add one data point with a value that is either *larger or smaller* than the others, the chart will display correctly.
I have noticed that when I plot a chart with smaller data values which are all the same value (so that the chart displays correctly), the value on the Y axis ends up showing 7 zeros after the decimal point. This seems to occur only when there is a single data point on the Y axis. When I have multiple data points, none of them show the decimal point with zeros after it, for example:
10000000.0000000
Now, adding a decimal point plus 7 zeros to a number which is already large makes for a lot of digits to display. I am wondering if that has something to do with this problem.
Does anyone know if there is a way to prevent the chart from showing the Y axis numbers as floating point, instead of integer (i.e. truncate the decimal point plus zeros)?
Also, I tried running with JRE 1.5.0_02, and although I did not get the exception anymore, the chart showed up as empty. So I'm not sure that JRE 1.5 is going to fix this problem.
For farily large values, it seems it takes about 8 or 9 digits to trigger the problem. As soon as I add one data point with a value that is either *larger or smaller* than the others, the chart will display correctly.
I have noticed that when I plot a chart with smaller data values which are all the same value (so that the chart displays correctly), the value on the Y axis ends up showing 7 zeros after the decimal point. This seems to occur only when there is a single data point on the Y axis. When I have multiple data points, none of them show the decimal point with zeros after it, for example:
10000000.0000000
Now, adding a decimal point plus 7 zeros to a number which is already large makes for a lot of digits to display. I am wondering if that has something to do with this problem.
Does anyone know if there is a way to prevent the chart from showing the Y axis numbers as floating point, instead of integer (i.e. truncate the decimal point plus zeros)?
Also, I tried running with JRE 1.5.0_02, and although I did not get the exception anymore, the chart showed up as empty. So I'm not sure that JRE 1.5 is going to fix this problem.
Hi,
I've a similar kind of problem.
In my case, ChartEntity.getCoords() returns negative coordinates causing "sun.dc.pr.PRException: endPath: bad path" exception.
Here is the sample code. It creates a XYBar chart using TimeSeriesCollection data and stores the chart as 'verticalXYBar.png', 'verticalXYBar.html'.
When I open the html-file [ verticalXYBar.html] in a browser, tooltip appears in a wrong place due to the negative coordinates.
This seems to happen only when TimeSeries has only one item.
If I add more than one item to the TimeSeries (uncomment the LINE-1, LINE-2, LINE-3 in the code) and run this program this exception won't occur.
I've a similar kind of problem.
In my case, ChartEntity.getCoords() returns negative coordinates causing "sun.dc.pr.PRException: endPath: bad path" exception.
Here is the sample code. It creates a XYBar chart using TimeSeriesCollection data and stores the chart as 'verticalXYBar.png', 'verticalXYBar.html'.
When I open the html-file [ verticalXYBar.html] in a browser, tooltip appears in a wrong place due to the negative coordinates.
This seems to happen only when TimeSeries has only one item.
If I add more than one item to the TimeSeries (uncomment the LINE-1, LINE-2, LINE-3 in the code) and run this program this exception won't occur.
Code: Select all
/**
* Using JFreeChart v0.9.21, JCommon 0.9.6
*/
import java.io.*;
import org.jfree.chart.*;
import org.jfree.chart.entity.StandardEntityCollection;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.time.*;
import org.jfree.data.xy.IntervalXYDataset;
public class TimeSeriesProblem {
public TimeSeriesProblem() {
}
public static void main(String args[]) {
IntervalXYDataset data = createDataset();
JFreeChart jfreechart = ChartFactory.createXYBarChart("title", "xAxisLabel", true,
"yAxisLabel",
(IntervalXYDataset) data,
PlotOrientation.VERTICAL, true, true, false);
saveChart(jfreechart);
}
private static IntervalXYDataset createDataset() {
TimeSeriesCollection timeseriescollection = new TimeSeriesCollection();
timeseriescollection.addSeries(createTimeSeries());
return timeseriescollection;
}
private static TimeSeries createTimeSeries() {
TimeSeries ts = new TimeSeries("Product Release Schedule", Month.class);
ts.add(new Month(7, 2002), 0.1);
//ts.add(new Month(8, 2002), 0.4); //------ LINE 1
//ts.add(new Month(9, 2002), 0.9); //------ LINE 2
//ts.add(new Month(10, 2002), 1.0);//----- LINE 3
return ts;
}
public static void saveChart(JFreeChart jfreechart) {
try {
ChartRenderingInfo chartrenderinginfo = new ChartRenderingInfo(new
StandardEntityCollection());
File file = new File("verticalXYBar.png");
ChartUtilities.saveChartAsPNG(file, jfreechart, 600, 400,
chartrenderinginfo);
File file1 = new File("verticalXYBar.html");
BufferedOutputStream bufferedoutputstream = new BufferedOutputStream(new
FileOutputStream(file1));
PrintWriter printwriter = new PrintWriter(bufferedoutputstream);
printwriter.println("<HTML>");
printwriter.println(
"<HEAD><TITLE>VerticalXYBar</TITLE></HEAD>");
printwriter.println("<BODY>");
ChartUtilities.writeImageMap(printwriter, "verticalXYBar", chartrenderinginfo);
printwriter.println("<IMG SRC=\"verticalXYBar.png\" WIDTH=\"600\" HEIGHT=\"400\" BORDER=\"0\" USEMAP=\"#verticalXYBar\">");
printwriter.println("</BODY>");
printwriter.println("</HTML>");
printwriter.close();
}
catch (IOException ioe) {
System.out.println(ioe.toString());
}
}
}