•<%@ page contentType="text/html;charset=euc-kr"%>
•<%@ page import="org.jfree.data.general.DefaultPieDataset"%>
•<%@ page import="org.jfree.chart.JFreeChart"%>
•<%@ page import="org.jfree.chart.plot.PiePlot"%>
•<%@ page import="org.jfree.chart.ChartRenderingInfo"%>
•<%@ page import="org.jfree.chart.servlet.ServletUtilities"%>
•<%@ page import="org.jfree.chart.urls.StandardPieURLGenerator"%>
•<%@ page import="org.jfree.chart.entity.StandardEntityCollection"%>
•<%@ page import="org.jfree.chart.ChartFactory"%>
•<%@ page import="org.jfree.chart.ChartUtilities"%>
•<%@ page import="org.jfree.data.general.PieDataset"%>
•<%@ page import="org.jfree.data.category.DefaultCategoryDataset"%>
•<%@ page import="org.jfree.chart.plot.PlotOrientation"%>
•<%@ page import="java.io.*"%>
•<%
•try {
• DefaultPieDataset dataset2 = new DefaultPieDataset();
• dataset2.setValue("male", 20);
• dataset2.setValue("female", 16);
•
• JFreeChart chart2 = ChartFactory.createPieChart("Pie Chart", dataset2, true, true, false);
• chart2.setBackgroundPaint(java.awt.Color.white);
• chart2.setTitle("gender");
• ChartRenderingInfo info2 = new ChartRenderingInfo(new StandardEntityCollection());
• String fileName2 = "C:/" + "K0002.jpeg";
• ChartUtilities.saveChartAsJPEG(new File(fileName2),chart2,600,300,info2);
•
•} catch (Exception e) {
• System.out.println("error!!");
•}
•%>
•<img src="C:/K0002.jpeg"/>