I'm just trying to run a demo of a 'simple' pie chart I found online. I'm running this in Eclipse Kepler and I keep getting,
Exception in thread "main" java.lang.NullPointerException
at org.apache.fontbox.afm.AFMParser.main(AFMParser.java:304)
when I try to run the program. I would think, considering where I got the code (linked off of a JChart site), that it would run without issue. Just trying to see if anyone can see something I can't.
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.data.general.DefaultPieDataset;
public class BarChartDemo {
public static void main(String[] args){
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("Category 1", 50.0);
dataset.setValue("Category 2", 50.0);
JFreeChart chart = ChartFactory.createPieChart(
"Sample Pie Chart",
dataset,
true,
true,
false
);
ChartFrame frame = new ChartFrame("First",chart);
frame.pack();
frame.setVisible(true);
}
}