PieChart3D guide

Chart component family release : 1.1

1.   General description
2.   Installation
3.   Simple usage
4.   Component reference
5.   Known limitations

1. General description

This component acts you to create a Pie Chart 3D image for your html page

2. Installation

To use the Pie Chart 3D component you can choose to install the entire jenia4faces library or to install only the jar file containing the chart family components.
In the second case you need to download two separate jar, the commons component library and the chart component library.
After downloading, you must copy downloaded file/files in your WEB-INF/lib directory.
If you have already installed some jenia4faces component you didn't need anything other, followings are jenia4faces commons installation step.
The last installation step is to modify the web.xml file of your web application and add a new servlet.
The new servlet must be associated with the org.jenia.faces.util.Servlet java class and must be mapped with this pattern : /jenia4faces/*
This is an example of the new configurations :
<servlet>
    <servlet-name>Jenia internal servlet</servlet-name>
    <servlet-class>org.jenia.faces.util.Servlet</servlet-class>
    <load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Jenia internal servlet</servlet-name>
    <url-pattern>/jenia4faces/*</url-pattern>
</servlet-mapping>

Now you have correctly installed the dataTools component. Enjoy your development.

Requirements:

jfreechart
we have tested the library using:
  jfreechart-1.0.0-rc1.jar
  jcommon-1.0.0-rc1.jar

batik 1.6
use only:
  batik.jar
  batik-svggen.jar
  batik-ext.jar
  batik-awt-util.jar
  batik-util.jar
  batik-dom.jar
  batik-xml.jar

3. Simple usage

This is a simple example of how to use the Pie Chart 3D component :

<%@ taglib uri="http://www.jenia.org/jsf/chart" prefix="jd" %>
...

<jd:pieChart3d pieDataSet="#{TestBean.dataset}" trasparency="0.6" color="#FFFFFF" chartTitle="prova Piechart3D" width="400" height="300" title="Prova PieChart3D" fileExt="png"/>


...

public class TestBean {
private PieDataset dataset;

public PieDataset getDataset() {
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("Fragole", 10);
dataset.setValue("Meloni", 40);
dataset.setValue("Cocomeri", 20);
dataset.setValue("Cliliegie", 30);

return dataset;
}
public void setDataset(PieDataset dataset) {
this.dataset = dataset
}
}

4. Component reference

In the counter text component you can also use these attributes :
id
The component identifier for this component.
This value must be unique within the closest parent component that is a naming container.
See general jsf documentation.

rendered
Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit.
See general jsf documentation.

binding
The value binding expression linking this component to a property in a backing bean
See general jsf documentation.

style
CSS style(s) to be applied when this component is rendered

styleClass
Space-separated list of CSS style class(es) to be applied when this element is rendered.
This value must be passed throughas the "class" attribute on generated markup.

title
Advisory title information about markup elements generated for this component.

chartTitle
Set the title of the chart that you want to render.

pieDataSet
The class PieDataset is the container of the data of your graph

color
Set the background color of your chart (default is #FFFFFF)

trasparency
Float parameter that indicates the trasparency of your Pie Graph

width
Set the width of the generated image

height
Set the height of the generated image

fileExt
Choose the format of the generated image (png, jpg, svg)

plotColor
Set the color of your chart

crush
Collapse the 3D Pie Chart into 2D Pie Chart (Default is false)

5. Known limitations

If you use Tomcat on Linux without an XServer you must say this to your JDK so:
export CATALINA_OPTS="-Djava.awt.headless=true"
is the solution to avoid any problem.



Component developed by Matteo necci        
For problems, help or contribution mail to teo@lacab.it