Chart TagLibs depends on FreeChart and JCommon for rendering the chart and commons-beanutils to work with beans properties. Put these library in your classpath:
Put this in your web.xml
<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>
Add the taglib definition to the JSP page
<%@ taglib uri="/WEB-INF/chart-tag.tld" prefix="chart" %>
JSP code:
<chart:pie collection="pieDataSet" category="label" value="value" title="Pie Chart" onlcick="Alert('Hello World Chart TagLibs')" />