Package resources

Source Code of resources.PieChart

package resources;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.data.general.DefaultPieDataset;
public class PieChart {
/**
* The starting point for the demo.
*
* @param args ignored.
*/

  public PieChart() {}
 
 
  public void loadChart() {
 
  DefaultPieDataset dataset = new DefaultPieDataset();
  dataset.setValue("Resp. Node", 3.0);
  dataset.setValue("Avg Length", 21.0);
  dataset.setValue("Component Path", 1.0);
  dataset.setValue("Resp. Node", 1.0);
  dataset.setValue("Avg Length", 19);
  dataset.setValue("Component Path", 1.0);
  // 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.setVisible(true);
  }
}
TOP

Related Classes of resources.PieChart

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.