import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.data.general.DefaultPieDataset;
public class JfreeChartPie {
System.out.println("piechart");
public static void main(String[] args) {
System.out.println("piechart");
// TODO Auto-generated method stub
// create a dataset...
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("Category 1", 43.2);
dataset.setValue("Category 2", 27.9);
dataset.setValue("Category 3", 79.5);
// create a chart...
JFreeChart chart = ChartFactory.createPieChart(
"Sample Pie Chart",
dataset,
true,
// legend?
true,
// tooltips?
false
// URLs?
);
// create and display a frame...
ChartFrame frame = new ChartFrame("First", chart);
//frame.pack();
frame.setSize(300, 300);
frame.setVisible(true);
}
}
I run debian 9 gnu linux and eclipse 2018-09 I get from console just the text about jfreechart license, and it seems that it doesen't exute the code.I have got no problems.