First import package Jfreechart and Jcommon
Second, configure the Out-of-the-box display class for Web.xml calls
< servlet >
< Servlet-name > Displaychart </servlet-name >
< Servlet-class > Org.jfree.chart.servlet.DisplayChart </servlet-class >
</servlet >
< servlet-mapping >
< Servlet-name > Displaychart </servlet-name >
< Url-pattern >/servlet/displaychart </url-pattern >
</servlet-mapping >
A detailed example of a column chart class
<%@ page contenttype= "TEXT/HTML;CHARSET=GBK"%> <%@ page import= Java.awt.Color, 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.*, Org.jfree.chart.plot.CategoryPlot, Org.jfree.chart.axis.CategoryAxis, Org.jfree.chart.axis.ValueAxis, Org.jfree.chart.renderer.category.BarRenderer3D, Org.jfree.chart.urls.StandardCategoryURLGenerator, org.jfree.chart.*, org.jfree.chart.entity.*, org.jfree.chart.labels.*, Org.jfree.chart.axis.CategoryLabelPositions, Java.awt.Font, Java.awt.GradientPaint, Org.jfree.ui.TextAnchor, Org.jfree.chart.axis.NumberAxis, Org.jfree.chart.axis.NumberTickUnit "%>