JFreeChart.draw

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
sido

JFreeChart.draw

Post by sido » Mon Apr 08, 2002 2:55 pm

hi, me again!

Thanks David for your explainations, it was very useful!
I have now another pb: i have created a PieChart, and i can edit it as a Frame, but i need it in the page, so i try to use chart.draw(), but i get an error that tells:

java.lang.NullPointerException
at com.jrefinery.chart.JFreeChart.draw(Unknown Source)

here is my code:
JFreeChart chart = ChartFactory.createPieChart("Test", data, true);
Component component = new Canvas() ;
Graphics graphics = component.getGraphics();
Graphics2D graphics2 = (Graphics2D)graphics;
Rectangle2D r2 = new Rectangle2D.Float(50,50,150,150);
chart.draw( graphics2, r2, new com.jrefinery.chart.DrawInfo());

Thanks for help,
sido.

Locked