java生成图表---采用jfreechart

java生成图表---采用jfreechart

1.引入jfreechart,jcommon的jar包。

   <dependency>
        	<groupId>org.jfree</groupId>
        	<artifactId>jfreechart</artifactId>
        	<version>1.0.14</version>
        	<type>jar</type>
        	<scope>compile</scope>
        </dependency>
        <dependency>
        	<groupId>org.jfree</groupId>
        	<artifactId>jcommon</artifactId>
        	<version>1.0.17</version>
        	<type>jar</type>
        	<scope>compile</scope>
        </dependency>


2.配置servelet

	<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>/DisplayChart</url-pattern> 
	</servlet-mapping> 

3.配置数据,生成图表

主要测试的有柱状图,饼状图,曲线图

你可能感兴趣的:(jfreechart)