/Users/20390/Desktop/jacob IA/src/newgui/graph.java |
1 package newgui;
2
3 import org.jfree.chart.ChartFactory;
4 import org.jfree.chart.ChartPanel;
5 import org.jfree.chart.JFreeChart;
6 import org.jfree.chart.plot.PlotOrientation;
7 import org.jfree.data.category.CategoryDataset;
8 import org.jfree.ui.ApplicationFrame;
9
10
11
12 @author
13
14 public class graph extends ApplicationFrame {
15
16 public graph(String applicationTitle, String chartTitle, CategoryDataset dataset) {
17
18 super(applicationTitle);
19
20 JFreeChart barChart = ChartFactory.createBarChart(chartTitle,"Category","Score",dataset,PlotOrientation.VERTICAL,
21 true, true, false);
22
23 ChartPanel chartPanel = new ChartPanel(barChart);
24 chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
25 setContentPane(chartPanel);
26 }
27 }
28