用JFreeChart吧,很简单的。以下是例子,你可以试下
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="org.jfree.chart.ChartFactory,
org.jfree.chart.JFreeChart,
org.jfree.chart.plot.PlotOrientation,
org.jfree.chart.servlet.ServletUtilities,
org.jfree.data.category.CategoryDataset,
org.jfree.data.general.DatasetUtilities"%>
<%
double[][] data = newdouble[][] {{1310}, {720}, {1130}, {440}};
String[] rowKeys ={"猪肉", "牛肉","鸡肉", "鱼肉"};
String[] columnKeys ={""};
CategoryDataset dataset = DatasetUtilities.createCategoryDataset(rowKeys, columnKeys, data);
JFreeChart chart = ChartFactory.createBarChart3D("广州肉类销量统计图", "肉类",
"销量",
dataset,
PlotOrientation.VERTICAL,
true,
false,
false);
String filename = ServletUtilities.saveChartAsPNG(chart, 500, 300, null, session);
String graphURL = request.getContextPath() +"/DisplayChart?filename="+ filename;
%>
<img src="<%= graphURL %>"width=500 height=300 border=0 usemap="#<%= filename %>">
可以自己动手试试。这里可以参考http://www.blogjava.net/amigoxie/archive/2007/
09/30/149765.html
网上资料很多,可以找找看