Getting Started


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

Copy chart-tag.tld to WEB-INF directory. Get chart-tag.tld from chart-taglibs-x.x.jar file (unzip).

JSP page

Add the taglib definition to the JSP page

<%@ taglib uri="/WEB-INF/chart-tag.tld" prefix="chart" %>

Example (Pie Chart)

JSP code:

<chart:pie collection="pieDataSet" category="label" value="value" 
  title="Pie Chart" onlcick="Alert('Hello World Chart TagLibs')" />
Where pieDataSet is a collection (Vector,ArrayList,..) of a simple JavaBean (POJO) present in any scope (page, request, session, application) , label and value are attribute of this JavaBean with getters and setters. Take a look to the demonstration application for more examples, and see chart-tag.tld for more options.