I have the following error when the value of a pie sector is zero, the code is:
public Pie3DChartDemo1(String title) {
super(title);
DefaultPieDataset data = new DefaultPieDataset();
data.setValue("Java", new Double(43.2));
data.setValue("Visual Basic", new Double(10.0));
data.setValue("C/C++", new Double(17.5));
data.setValue("PHP", new Double(32.5));
data.setValue("Perl", new Double(0.0));
JFreeChart chart = ChartFactory.createPie3DChart("Pie Chart 3D Demo 1", data, true);
chart.setBackgroundPaint(Color.yellow);
Pie3DPlot plot = (Pie3DPlot) chart.getPlot();
plot.setStartAngle(270);
plot.setDirection(Pie3DPlot.CLOCKWISE);
plot.setForegroundAlpha(0.75f);
ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
setContentPane(chartPanel);
}
the error is:
java.lang.NullPointerException
at sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:53)
at sun.java2d.pipe.DuctusShapeRenderer.fill(DuctusShapeRenderer.java:49)
at sun.java2d.SunGraphics2D.fill(SunGraphics2D.java:2190)
at com.jrefinery.chart.Pie3DPlot.draw(Pie3DPlot.java:298)
at com.jrefinery.chart.JFreeChart.draw(JFreeChart.java:618)
at com.jrefinery.chart.ChartPanel.paintComponent(ChartPanel.java:800)
at javax.swing.JComponent.paint(JComponent.java:804)
at javax.swing.JComponent.paintChildren(JComponent.java:643)
at javax.swing.JComponent.paint(JComponent.java:813)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:552)
at javax.swing.JComponent.paintChildren(JComponent.java:643)
at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4742)
at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4688)
at javax.swing.JComponent.paint(JComponent.java:794)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
at java.awt.Container.paint(Container.java:1123)
at sun.awt.RepaintArea.paint(RepaintArea.java:180)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:260)
at java.awt.Component.dispatchEventImpl(Component.java:3586)
at java.awt.Container.dispatchEventImpl(Container.java:1437)
at java.awt.Window.dispatchEventImpl(Window.java:1566)
at java.awt.Component.dispatchEvent(Component.java:3367)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
Problem in Pie3D
Re: Problem in Pie3D
Hi David,
Thanks for reporting this. I've fixed the bug and committed the change to CVS for inclusion in 0.9.5.
Regards,
DG
Thanks for reporting this. I've fixed the bug and committed the change to CVS for inclusion in 0.9.5.
Regards,
DG
Re: Problem in Pie3D
Hi !
I have the same problem.
Where can I find the fixed version ( 0.9.5 ) ?
Thanks.
I have the same problem.
Where can I find the fixed version ( 0.9.5 ) ?
Thanks.