A simple implementation of the {@link JFreeChartResource} where all the data is given in the constructor.
This implementation defines no content-disposition header
17181920212223
DefaultKeyedValuesDataset dataset = new DefaultKeyedValuesDataset(); dataset.setValue("one", 50); dataset.setValue("two", 20); dataset.setValue("three", 30); JFreeChart chart = ChartFactory.createPieChart("My Piechart", dataset, false, false, false); return new SimpleJFreeChartResource(chart, 100, 200, ImageFormat.JPEG); }