Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DefaultPieDataset pieDataset = new DefaultPieDataset();
- pieDataset.setValue("JavaWorld", new Integer(75));
- pieDataset.setValue("Other", new Integer(25));
- JFreeChart chart = ChartFactory.createPieChart
- ("Sample Pie Chart", // Title
- pieDataset // Dataset
- );
- BufferedImage image = chart.createBufferedImage(500,300);
- JLabel lblChart = new JLabel();
- lblChart.setIcon(new ImageIcon(image));
- MyPanel.add(lblChart);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement